forked from OpenBazaar/OpenBazaar-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.py
30 lines (23 loc) · 917 Bytes
/
bootstrap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import subprocess
import sys
def bootstrap(testnet):
script_dir = os.path.dirname(os.path.abspath(__file__))
if sys.platform == "darwin":
# OSX won't pass the PATH
subprocess.call(['/usr/local/bin/pip', 'install', '-r', '%s/requirements.txt' % script_dir])
os.chdir(script_dir)
if testnet:
os.system('/usr/local/bin/python openbazaard.py start --testnet')
else:
os.system('/usr/local/bin/python openbazaard.py start')
else:
subprocess.call(['pip', 'install', '-r', '%s%srequirements.txt' % (script_dir, os.pathsep)])
os.chdir(script_dir)
if testnet:
os.system('python sopenbazaard.py start --testnet')
else:
os.system('python openbazaard.py start')
if __name__ == '__main__':
use_testnet = len(sys.argv) > 1 and sys.argv[1] == 'testnet'
bootstrap(use_testnet)