mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-11-12 20:23:15 -06:00
respect output
This commit is contained in:
parent
49164f8b1b
commit
e7476a6863
1 changed files with 11 additions and 5 deletions
|
@ -52,7 +52,7 @@ from typing import (
|
||||||
from urllib.error import HTTPError
|
from urllib.error import HTTPError
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
|
|
||||||
__version__ = "23.5a1-14-gd7717ff"
|
__version__ = "23.5a1-14-g49164f8"
|
||||||
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
|
@ -1168,8 +1168,12 @@ class Viv:
|
||||||
else:
|
else:
|
||||||
error("please specify an explicit -b/--bin and -o/--output", code=1)
|
error("please specify an explicit -b/--bin and -o/--output", code=1)
|
||||||
|
|
||||||
|
if args.output:
|
||||||
|
output = args.output
|
||||||
|
|
||||||
if output.is_file():
|
if output.is_file():
|
||||||
error(f"{output} already exists...exiting", code=1)
|
error(f"{output} already exists...exiting", code=1)
|
||||||
|
|
||||||
if args.standalone:
|
if args.standalone:
|
||||||
imports = STANDALONE_TEMPLATE.format(
|
imports = STANDALONE_TEMPLATE.format(
|
||||||
version=__version__, func=noqa(STANDALONE_TEMPLATE_FUNC)
|
version=__version__, func=noqa(STANDALONE_TEMPLATE_FUNC)
|
||||||
|
@ -1194,11 +1198,13 @@ class Viv:
|
||||||
imports = ""
|
imports = ""
|
||||||
use = IMPORT_TEMPLATE.format(spec=spec)
|
use = IMPORT_TEMPLATE.format(spec=spec)
|
||||||
|
|
||||||
# TODO: confirm next steps?
|
if confirm(
|
||||||
with output.open("w") as f:
|
f"Write shim for {a.style(bin,'bold')} to {a.style(output,'green')}?"
|
||||||
f.write(SHIM_TEMPLATE.format(imports=imports, use=use, bin=bin))
|
):
|
||||||
|
with output.open("w") as f:
|
||||||
|
f.write(SHIM_TEMPLATE.format(imports=imports, use=use, bin=bin))
|
||||||
|
|
||||||
make_executable(output)
|
make_executable(output)
|
||||||
|
|
||||||
def _get_subcmd_parser(
|
def _get_subcmd_parser(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Reference in a new issue