feat: make shims overwriteable

This commit is contained in:
Daylin Morgan 2023-07-31 15:26:30 -05:00
parent 5e2a62d527
commit 4d75feb9e3
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -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.5a6-dev" __version__ = "23.5a6-3-g5e2a62d-dev"
class Spinner: class Spinner:
@ -1352,14 +1352,14 @@ class Viv:
default_bin, bin = self._pick_bin(reqs, bin) default_bin, bin = self._pick_bin(reqs, bin)
output = Env().viv_bin_dir / default_bin if not output else output.absolute() output = Env().viv_bin_dir / default_bin if not output else output.absolute()
if output.is_file():
err_quit(f"{output} already exists...exiting")
if freeze: if freeze:
spec = resolve_deps(reqs, requirements) spec = resolve_deps(reqs, requirements)
else: else:
spec = combined_spec(reqs, requirements) spec = combined_spec(reqs, requirements)
if output.is_file():
log.warning(f"{output} already exists")
if confirm( if confirm(
f"Write shim for {a.bold}{bin}{a.end} to {a.green}{output}{a.end}?", f"Write shim for {a.bold}{bin}{a.end} to {a.green}{output}{a.end}?",
yes=yes, yes=yes,