From 438f05677125c2586b98d3cac6090809cd1f9ceb Mon Sep 17 00:00:00 2001 From: staticsafe Date: Wed, 25 Jul 2012 22:40:00 -0400 Subject: [PATCH] removing OSX package manager support. POSIX compatiblity fixes. --- envsetup.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/envsetup.sh b/envsetup.sh index ffbbcdd..ff6f465 100755 --- a/envsetup.sh +++ b/envsetup.sh @@ -27,7 +27,6 @@ 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. hash pkg_add &>/dev/null && userdistro="FreeBSD" # For FreeBSD } @@ -38,21 +37,18 @@ installpackages() { sudo yum install -y vim zsh tmux git subversion mercurial most python-pip elif [[ "$userdistro" == "Arch" ]]; then sudo pacman --noconfirm -S vim zsh tmux git mercurial subversion most python-pip - elif [[ "$userdistro" == "OSX" ]]; then - sudo port install vim zsh tmux git-core git-extras mercurial subversion most - #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. elif [[ "$userdistro" == "FreeBSD" && $(uname -s) == "FreeBSD" ]]; then sudo pkg_add -r vim zsh tmux git subversion mercurial most py27-pip else - die 'Your distro does not have a package manager supported by this script, exiting!' + printf '%s\n' "Your distro's package manager is not supported in this script, continuing with changing shell & linking dotfiles." fi } changeshell() { - if [[ $SHELL == "/usr/bin/zsh" || $SHELL == "/bin/zsh" ]]; then + if [[ $SHELL == $(command -v zsh) ]]; then printf '%s\n' "Your default shell is already zsh, continuing." else - chsh -s $(which zsh) + chsh -s $(command -v zsh) printf '%s\n' "Default shell changed to zsh, logout and login to see changes" fi }