mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-12-22 02:30:44 -06:00
feat(#19): add --generate flag for viv shim
This commit is contained in:
parent
c43f2f027c
commit
1b8bcb4454
1 changed files with 7 additions and 0 deletions
|
@ -3469,6 +3469,7 @@ class Viv:
|
||||||
bin: str,
|
bin: str,
|
||||||
output: Path,
|
output: Path,
|
||||||
freeze: bool,
|
freeze: bool,
|
||||||
|
generate: bool,
|
||||||
yes: bool,
|
yes: bool,
|
||||||
path: str,
|
path: str,
|
||||||
standalone: bool,
|
standalone: bool,
|
||||||
|
@ -3500,6 +3501,11 @@ class Viv:
|
||||||
with output.open("w") as f:
|
with output.open("w") as f:
|
||||||
f.write(self.t.shim(path, self.local_source, standalone, spec, bin))
|
f.write(self.t.shim(path, self.local_source, standalone, spec, bin))
|
||||||
make_executable(output)
|
make_executable(output)
|
||||||
|
if generate:
|
||||||
|
vivenv = ViVenv(spec)
|
||||||
|
with vivenv.use():
|
||||||
|
vivenv.meta.addfile(output)
|
||||||
|
vivenv.meta.write()
|
||||||
|
|
||||||
def cmd_run(
|
def cmd_run(
|
||||||
self,
|
self,
|
||||||
|
@ -3583,6 +3589,7 @@ class Cli:
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
("shim",): [
|
("shim",): [
|
||||||
|
BoolArg(flag="generate", help="create vivenv w/shim"),
|
||||||
BoolArg(
|
BoolArg(
|
||||||
flag="freeze",
|
flag="freeze",
|
||||||
help="freeze/resolve all dependencies",
|
help="freeze/resolve all dependencies",
|
||||||
|
|
Loading…
Reference in a new issue