From 6f35cdae848bc043cb39903cd94894bbaf8da272 Mon Sep 17 00:00:00 2001 From: staticsafe Date: Fri, 30 Mar 2012 13:14:05 -0400 Subject: [PATCH] adding OSX support. --- envsetup.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/envsetup.sh b/envsetup.sh index aa1a8ff..bb3ac28 100755 --- a/envsetup.sh +++ b/envsetup.sh @@ -3,8 +3,6 @@ # Environment setup redone in bash, because using call in Python is lame # Basic requirements - bash, sudo (Also make sure your user has sudo privileges!) -# TODO - OSX MacPorts support - # a die function as always die() { printf '%s\n' "$@" >&2 @@ -16,6 +14,8 @@ die() { userdistro="NULL" repo="https://github.com/staticsafe/dotfiles.git" +portpath="/opt/local/bin/port" # This is the default install directory for the MacPorts port binary, you may find this useful. + # Lets get this party on the road, shall we? sudocheck() { @@ -27,6 +27,7 @@ distrocheck() { hash apt-get &>/dev/null && userdistro="Debian" # For Debian based distros. hash yum &>/dev/null && userdistro="Fedora" # For RHEL/CentOS/Fedora hash pacman &>/dev/null && userdistro="Arch" # For Arch Linux + hash port &>/dev/null && userdistro="OSX" # For OSX, make sure the port binary is in your PATH first. } installpackages() { @@ -36,6 +37,9 @@ installpackages() { sudo yum install -y vim zsh tmux git subversion elif [[ "$userdistro" == "Arch" ]]; then sudo pacman --no-confirm -S vim zsh tmux git subversion + elif [[ "$userdistro" == "OSX" ]]; then + sudo port install vim zsh tmux git subversion + #echo "export PATH=/opt/local/bin:/opt/local/sbin:$PATH" >> ~/.zshenv # This adds the port binary path, so that zsh can use it after, commented out by default. else die 'Your distro does not have a package manager supported by this script, exiting!' fi