forked from Lunatic-Labs/rubricapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupEnv.py
49 lines (46 loc) · 1.53 KB
/
setupEnv.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from sys import platform
import os
# short script to get environment running before running tests
def main():
if platform == "linux" or platform == "linux2":
accountFile = os.getcwd() + os.path.join(os.path.sep, "instance") + os.path.join(os.path.sep, "account.db")
try:
os.system("rm " + accountFile)
except:
pass
try:
os.system("rm -r users")
except:
pass
os.system("mkdir users")
os.system("python3 dbcreate.py .")
os.system("python3 run.py .")
elif platform == "darwin":
accountFile = os.getcwd() + os.path.join(os.path.sep, "core") + os.path.join(os.path.sep, "account.db")
try:
os.system("rm " + accountFile)
except:
pass
try:
os.system("rm -r users")
except:
pass
os.system("mkdir users")
os.system("python3 dbcreate.py .")
os.system("python3 run.py .")
elif platform == "win32":
accountFile = os.getcwd() + os.path.join(os.path.sep, "core") + os.path.join(os.path.sep, "account.db")
try:
os.system("del " + "\"" + accountFile + "\"")
except:
pass
usersFile = os.getcwd() + os.path.join(os.path.sep, "users")
try:
os.system("rmdir " + "\"" + usersFile + "\"")
except:
pass
os.system("mkdir users")
os.system("python dbcreate.py .")
os.system("python run.py .")
if __name__ == "__main__":
main()