better goldwarden command path detection
in this way works always
This commit is contained in:
parent
f3196863bb
commit
200bce7d7e
1 changed files with 9 additions and 3 deletions
|
|
@ -1,13 +1,19 @@
|
||||||
import subprocess
|
import subprocess
|
||||||
import json
|
import json
|
||||||
|
from shutil import which
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
# if flatpak
|
# if flatpak
|
||||||
if os.path.exists("/app/bin/goldwarden"):
|
if os.path.exists("/app/bin/goldwarden"):
|
||||||
BINARY_PATH = "/app/bin/goldwarden"
|
BINARY_PATH = "/app/bin/goldwarden"
|
||||||
else:
|
else:
|
||||||
res = subprocess.run(["which", "goldwarden"])
|
BINARY_PATH = which('goldwarden')
|
||||||
BINARY_PATH = res.stdout.decode("utf-8").strip()
|
if isinstance(BINARY_PATH,str):
|
||||||
|
BINARY_PATH = BINARY_PATH.strip()
|
||||||
|
else:
|
||||||
|
print("goldwarden executable not found")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
def set_api_url(url):
|
def set_api_url(url):
|
||||||
restic_cmd = f"{BINARY_PATH} config set-api-url {url}"
|
restic_cmd = f"{BINARY_PATH} config set-api-url {url}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue