better goldwarden command path detection
in this way works always
This commit is contained in:
parent
f3196863bb
commit
200bce7d7e
|
@ -1,13 +1,19 @@
|
|||
import subprocess
|
||||
import json
|
||||
from shutil import which
|
||||
import os
|
||||
import sys
|
||||
|
||||
# if flatpak
|
||||
if os.path.exists("/app/bin/goldwarden"):
|
||||
BINARY_PATH = "/app/bin/goldwarden"
|
||||
else:
|
||||
res = subprocess.run(["which", "goldwarden"])
|
||||
BINARY_PATH = res.stdout.decode("utf-8").strip()
|
||||
BINARY_PATH = which('goldwarden')
|
||||
if isinstance(BINARY_PATH,str):
|
||||
BINARY_PATH = BINARY_PATH.strip()
|
||||
else:
|
||||
print("goldwarden executable not found")
|
||||
sys.exit()
|
||||
|
||||
def set_api_url(url):
|
||||
restic_cmd = f"{BINARY_PATH} config set-api-url {url}"
|
||||
|
@ -181,4 +187,4 @@ def run_daemon():
|
|||
print(line.decode("utf-8"))
|
||||
result.wait()
|
||||
print("quitting goldwarden daemon")
|
||||
return result.returncode
|
||||
return result.returncode
|
||||
|
|
Loading…
Reference in New Issue