Skip to content

Commit

Permalink
feat(#19): add --generate flag for viv shim
Browse files Browse the repository at this point in the history
  • Loading branch information
daylinmorgan committed Apr 18, 2024
1 parent c43f2f0 commit 1b8bcb4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/viv/viv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3469,6 +3469,7 @@ def cmd_shim(
bin: str,
output: Path,
freeze: bool,
generate: bool,
yes: bool,
path: str,
standalone: bool,
Expand Down Expand Up @@ -3500,6 +3501,11 @@ def cmd_shim(
with output.open("w") as f:
f.write(self.t.shim(path, self.local_source, standalone, spec, bin))
make_executable(output)
if generate:
vivenv = ViVenv(spec)
with vivenv.use():
vivenv.meta.addfile(output)
vivenv.meta.write()

def cmd_run(
self,
Expand Down Expand Up @@ -3583,6 +3589,7 @@ class Cli:
),
],
("shim",): [
BoolArg(flag="generate", help="create vivenv w/shim"),
BoolArg(
flag="freeze",
help="freeze/resolve all dependencies",
Expand Down

0 comments on commit 1b8bcb4

Please # to comment.