forked from joeferraro/MavensMate-SublimeText
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.py
More file actions
66 lines (57 loc) · 2.26 KB
/
install.py
File metadata and controls
66 lines (57 loc) · 2.26 KB
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
try:
import os
import sys
import platform
import shutil
import argparse
import pipes
install_paths = {
"darwin" : os.path.expanduser("~/Library/Application Support/Sublime Text 2/Packages/MavensMate"),
"win32" : "",
"cygwin" : "",
"linux2" : os.path.expanduser("~/.config/sublime-text-2/Packages/MavensMate")
}
user_settings_path = {
"darwin" : os.path.expanduser("~/Library/Application Support/Sublime Text 2/Packages/User"),
"win32" : "",
"cygwin" : "",
"linux2" : os.path.expanduser("~/.config/sublime-text-2/Packages/User")
}
sys_platform = sys.platform
install_path = install_paths[sys_platform]
user_settings_path = user_settings_path[sys_platform]
branch = None
git_url = pipes.quote('git://github.com/manandoshi9/MavensMate-SublimeText.git')
def install_from_source():
branch = '2.0'
os.system("git clone {0} {1}".format(git_url, pipes.quote(install_path)))
def install_user_settings():
if os.path.isfile(user_settings_path+"/mavensmate.sublime-settings") == False:
os.system("cp {0} {1}".format(
pipes.quote(install_path+"/mavensmate.sublime-settings"),
pipes.quote(user_settings_path)
))
def delete_32_or_64():
platform_arch = platform.architecture()[0]
if ( platform_arch == '32bit' ):
os.system ( "rm -rf {0}".format(pipes.quote(install_path + "/support/linux64" ) ) )
else:
os.system ( "rm -rf {0}".format(pipes.quote(install_path + "/support/linux32" ) ) )
def uninstall():
os.system("rm -rf {0}".format(pipes.quote(install_path)))
def install():
uninstall()
install_from_source()
if ( sys_platform == 'linux2' ):
delete_32_or_64()
install_user_settings()
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-b', '--branch') #name of the branch being requested
args = parser.parse_args()
if args.branch != None and args.branch != '':
branch = args.branch
install()
except Exception as e:
print('install.py issue')
print(e.message)