summaryrefslogtreecommitdiff
path: root/backend/resilient/bsv_metanet.py
diff options
context:
space:
mode:
authorIkiWiki <ikiwiki.info>2020-03-03 03:49:46 -0500
committerIkiWiki <ikiwiki.info>2020-03-03 03:49:46 -0500
commit4b743a1f2435454da297ff55d531157101d77f7e (patch)
tree42855742ca28c7124971c5a2164aab9db007c7ee /backend/resilient/bsv_metanet.py
parent70e0dbc4c60b1bb66aa3aee2563897620be6302a (diff)
downloadstandingwithresilience-4b743a1f2435454da297ff55d531157101d77f7e.tar.gz
standingwithresilience-4b743a1f2435454da297ff55d531157101d77f7e.zip
install bsvup locally if missing
Diffstat (limited to 'backend/resilient/bsv_metanet.py')
-rw-r--r--backend/resilient/bsv_metanet.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/backend/resilient/bsv_metanet.py b/backend/resilient/bsv_metanet.py
index 3d21b3e..62bf6c1 100644
--- a/backend/resilient/bsv_metanet.py
+++ b/backend/resilient/bsv_metanet.py
@@ -7,9 +7,16 @@ import time
class bsvup():
binary = "bsvup"
- found = (os.system("%s" % binary) == 0)
+ found = (os.system("%s --version" % binary) == 0)
# TODO: check dep_path for alternate location for binary
if not found:
+ binary = "%s/prefix/bin/bsvup" % dep_path
+ found = (os.system("%s --version" % binary) == 0)
+ if not found:
+ print("bsvup not found: attempting to install")
+ os.system("npm install --prefix %s/prefix -g %s/bsvup" % (dep_path, dep_path))
+ found = (os.system("%s --version" % binary) == 0)
+ if not found:
print("WARNING: bsvup not found. bsv metanet won't be updated")
def __init__(self, keyfile):