adding support for OSX
This commit is contained in:
parent
09e4015b02
commit
c78e80ecd9
21
envsetup.py
21
envsetup.py
|
@ -26,6 +26,15 @@ def sudocheck():
|
||||||
else:
|
else:
|
||||||
print 'Sudo check: PASSED!'
|
print 'Sudo check: PASSED!'
|
||||||
|
|
||||||
|
def macportscheck():
|
||||||
|
# This function checks if MacPorts exists on a OSX machine or not
|
||||||
|
portspath = "/opt/local/bin/port"
|
||||||
|
if os.path.isfile(portspath) === False:
|
||||||
|
print "We need MacPorts to run this script for you! Get it from here - http://www.macports.org/"
|
||||||
|
raise SystemExit
|
||||||
|
else:
|
||||||
|
print "MacPorts check: PASSED!"
|
||||||
|
|
||||||
def urldownload(confurl = ""):
|
def urldownload(confurl = ""):
|
||||||
#Thanks PabloG from StackOverflow for this little snippet - http://stackoverflow.com/a/22776
|
#Thanks PabloG from StackOverflow for this little snippet - http://stackoverflow.com/a/22776
|
||||||
url = confurl
|
url = confurl
|
||||||
|
@ -125,6 +134,15 @@ def envDebian():
|
||||||
#Get relevant dotfiles
|
#Get relevant dotfiles
|
||||||
checksandactions()
|
checksandactions()
|
||||||
|
|
||||||
|
def envOSX():
|
||||||
|
sudocheck()
|
||||||
|
macportscheck()
|
||||||
|
#Install relevant packages
|
||||||
|
installpackages = call ("sudo /opt/local/bin/port install vim zsh tmux git subversion", shell=True)
|
||||||
|
|
||||||
|
#Get relevant dotfiles
|
||||||
|
checksandactions()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
#homedircheck
|
#homedircheck
|
||||||
homedir = os.environ['HOME']
|
homedir = os.environ['HOME']
|
||||||
|
@ -138,6 +156,7 @@ def main():
|
||||||
|
|
||||||
#distrocheck
|
#distrocheck
|
||||||
userdistro = platform.linux_distribution()
|
userdistro = platform.linux_distribution()
|
||||||
|
osxcheck = platform.uname() # linux_distribution is useless on OSX so we use this
|
||||||
|
|
||||||
if userdistro[0] == "Fedora":
|
if userdistro[0] == "Fedora":
|
||||||
envFedora()
|
envFedora()
|
||||||
|
@ -147,6 +166,8 @@ def main():
|
||||||
envArch()
|
envArch()
|
||||||
elif userdistro[0] == "Ubuntu":
|
elif userdistro[0] == "Ubuntu":
|
||||||
envDebian()
|
envDebian()
|
||||||
|
elif osxcheck[0] == "Darwin":
|
||||||
|
envOSX()
|
||||||
else:
|
else:
|
||||||
print "This script is not supported for your distro, exiting."
|
print "This script is not supported for your distro, exiting."
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
Loading…
Reference in New Issue