Check if in venv before attempting user install/update.

This commit is contained in:
Serial_Jaywalker
2024-12-16 01:52:03 -08:00
parent bcdd88c725
commit c0a57c7814

View File

@@ -128,9 +128,13 @@ def update_app(force=False):
"install",
APP_NAME,
"-U",
"--user",
"--no-warn-script-location",
]
if sys.prefix == sys.base_prefix:
# ensure NOT in a venv, where --user flag can cause an error.
# TODO: Get value of 'include-system-site-packages' in pyenv.cfg.
args.append('--user')
process = subprocess.run(args)
if process.returncode == 0:
return True, release_json