Skip to content

Commit

Permalink
Merge pull request #109 from Mte90/patch-1
Browse files Browse the repository at this point in the history
better goldwarden command path detection
  • Loading branch information
quexten authored Feb 9, 2024
2 parents f319686 + 200bce7 commit 8a41543
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ui/goldwarden.py
Original file line number Diff line number Diff line change
@@ -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}"
Expand Down Expand Up @@ -181,4 +187,4 @@ def run_daemon():
print(line.decode("utf-8"))
result.wait()
print("quitting goldwarden daemon")
return result.returncode
return result.returncode

0 comments on commit 8a41543

Please sign in to comment.