-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun.py
63 lines (50 loc) · 2 KB
/
run.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import os
import sys
import subprocess
################################################################
__arg1 = sys.argv[1] if len(sys.argv) > 1 else ""
__arg2 = sys.argv[2] if len(sys.argv) > 2 else ""
__needUpdate = __arg1 == "--update" or __arg1 == "-u"
__workingDir = os.path.dirname(os.path.abspath(__file__))
################################################################
try:
import yaml
except ModuleNotFoundError:
os.system("pip3 install PyYAML")
################################################################
def downloadGitTo(url, path):
print("\ndownload:", url)
if os.path.isdir(path):
if __needUpdate:
os.chdir(path)
subprocess.run(['git', 'pull'], check=True)
else:
print("exist!")
else:
try:
subprocess.run(['git', 'clone', url, path], check=True)
print("Git clone completed successfully.")
except subprocess.CalledProcessError as e:
print(f"An error occurred while cloning: {e}")
pass
################################################################
downloadGitTo("git@github.com:Atypicalim/my-build-tools.git", "../my-build-tools")
downloadGitTo("git@github.com:Atypicalim/pure-js-tools.git", "../pure-js-tools")
downloadGitTo("git@github.com:Atypicalim/c-pure-tools.git", "../c-pure-tools")
downloadGitTo("git@github.com:Atypicalim/c-xtra-tools.git", "../c-xtra-tools")
downloadGitTo("git@github.com:Atypicalim/replay.git", "../c-replay-library")
downloadGitTo("git@github.com:Atypicalim/replot.git", "../c-replot-library")
################################################################
os.chdir(__workingDir)
if __needUpdate:
print("\nupdateing self:")
subprocess.run(['git', 'pull'], check=True)
################################################################
from scripts.base import *
import scripts.bind
# import scripts.converter
# import scripts.converting
# import scripts.extension
# import scripts.readme
# import scripts.document
import scripts.interpreter