-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsetup.py
84 lines (52 loc) · 2.37 KB
/
setup.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
64
65
66
67
68
69
#
# Tachyon
# setup.py
#
# Created on 14/08/17
# Ryan Maugin <[email protected]>
#
import os
import platform
class Setup():
def __init__(self):
print('+------------------------------------------------------+')
print('| Installing Tachyon - v1.0.0 alpha |')
print('| Developed By Ryan Maugin |')
print('+------------------------------------------------------+')
print("| Operating System : " + platform.system())
print("| Release : " + platform.release())
print("| Tachyon Version : v1.0 alpha []|")
def setup(self):
""" Setup
This method will find the OS install route and then perform the installation
for that specific OS
"""
# Check the platform and perform install for that platform
if platform.system() == "Darwin":
print('| MacOS Install Route []|')
self.mac_osx_install_route()
elif platform.system() == "Linux":
print('| Linux install route []|')
elif platform.system() == "Windows":
print('| Windows install route []|')
else:
print('| Default install route []|')
print("+------------------------------------------------------+")
def mac_osx_install_route(self):
""" MacOSX Install Route
This method will install the tachyon language on a mac by making a
tachyon executable and adding it the /usr/local/bin directory
"""
# CHOMD +X Changes the permissions of the fle to make it executable
os.system("chmod +x ./src/main.py")
print("| Set Tachyon Executable Permission []|")
# Add customised directory to the $PATH
os.system('export PATH="$PATH:$HOME/bin"')
print("| Add Customised Directory to $PATH []|")
# Create a symbolic link to the script
os.system("ln -s " + os.getcwd() + "/src/main.py /usr/local/bin/tachyon")
print("| Create Symbolic Link to Script []|")
#print(os.getcwd() + "/src/main.py")
if __name__ == "__main__":
installer = Setup()
installer.setup()