[fix][tray] update notifications not working when launched through IDEs

This commit is contained in:
Vinicius Moreira
2020-06-12 18:35:57 -03:00
parent 3ee6056814
commit 643b7b2593
2 changed files with 18 additions and 5 deletions

View File

@@ -28,10 +28,23 @@ from bauh.view.util.translation import I18n
def get_cli_path() -> str:
cli_path = system.run_cmd('which bauh-cli', print_error=False)
venv = os.getenv('VIRTUAL_ENV')
if venv:
cli_path = '{}/bin/bauh-cli'.format(venv)
if os.path.exists(cli_path):
return cli_path
elif not sys.executable.startswith('/usr'):
cli_path = '{}/bin/bauh-cli'.format(sys.prefix)
if os.path.exists(cli_path):
return cli_path
else:
cli_path = system.run_cmd('which bauh-cli', print_error=False)
if cli_path:
return cli_path.strip()
if cli_path:
return cli_path.strip()
def list_updates(logger: logging.Logger) -> List[PackageUpdate]: