From 4c236e96eb8490d733d411d706e460f508bc004f Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 18 Apr 2024 14:31:00 -0500 Subject: [PATCH] fix(#18): use --bin to determine default filename --- src/viv/viv.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/viv/viv.py b/src/viv/viv.py index 358a2b0..e6c07f3 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -3452,9 +3452,9 @@ class Viv: "`python3 <(curl -fsSL viv.dayl.in/viv.py) manage install`" ) - def _pick_bin(self, reqs: List[str], bin: str) -> Tuple[str, str]: + def _pick_bin(self, reqs: List[str], bin: str) -> str: default = system.bin(re.split(r"[=><~!*]+", reqs[0])[0]) - return default, (default if not bin else bin) + return default if not bin else bin def cmd_shim( self, @@ -3475,8 +3475,8 @@ class Viv: viv shim yartsu -o ~/bin/yartsu --standalone """ - default_bin, bin = self._pick_bin(reqs, bin) - output = Env().viv_bin_dir / default_bin if not output else output.absolute() + bin = self._pick_bin(reqs, bin) + output = Env().viv_bin_dir / bin if not output else output.absolute() if freeze: spec = resolve_deps(reqs, requirements) @@ -3520,7 +3520,7 @@ class Viv: if script: Script(path=script, spec=spec, keep=keep, rest=rest, viv=self).run() else: - _, bin = self._pick_bin(reqs, bin) + bin = self._pick_bin(reqs, bin) vivenv = ViVenv(spec) with vivenv.use(keep=keep):