fix(#7): don't error if no spec passed to viv run

This commit is contained in:
Daylin Morgan 2023-08-15 14:34:18 -05:00
parent 837dbb3e41
commit c5c8be0ed3
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -56,7 +56,7 @@ from typing import (
from urllib.error import HTTPError
from urllib.request import urlopen
__version__ = "23.8a3-17-g7b5d4ad-dev"
__version__ = "23.8a3-18-g837dbb3-dev"
class Spinner:
@ -1701,6 +1701,9 @@ class Viv:
env.update({"VIV_SPEC": " ".join(f"'{req}'" for req in spec)})
subprocess_run_quit([sys.executable, scriptpath, *rest], env=env)
elif not spec:
log.warning("using viv with empty spec, skipping vivenv creation")
subprocess_run_quit([sys.executable, scriptpath, *rest])
else:
vivenv = ViVenv(spec + deps)
if not vivenv.loaded or Env().viv_force: