forked from chandraacw/PySCli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_bin.py
More file actions
34 lines (27 loc) · 882 Bytes
/
setup_bin.py
File metadata and controls
34 lines (27 loc) · 882 Bytes
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
import os
import shutil
print("WARNING: TERMUX & LINUX ENVIRONTMENT ONLY")
def check_termux():
if os.path.exists("/data/data/com.termux/"):
return True
else:
return False
choose = input("Please Choose Number:\n1. Copy\n2. Symbolic Link\n> ") or None
st = os.stat("./PySCli.py")
os.chmod("./PySCli.py", st.st_mode | 0o111)
if choose is None or choose not in ["1", "2"]:
print("Please choose correctly")
exit()
elif choose == "1":
if check_termux():
shutil.copy("PySCli.py", "/data/data/com.termux/files/usr/bin/PySCli")
else:
shutil.copy("PySCli.py", "/usr/bin/PySCli")
elif choose == "2":
if check_termux():
os.symlink(
os.getcwd() + "/PySCli.py", "/data/data/com.termux/files/usr/bin/PySCli"
)
else:
shutil.copy(os.getcwd() + "/PySCli.py", "/usr/bin/PySCli")
print("Done!")