From f1d9ad4074b14869dcdffff92505b9ae11a90643 Mon Sep 17 00:00:00 2001 From: staticsafe Date: Mon, 9 Apr 2012 08:53:11 -0400 Subject: [PATCH] adding FreeBSD support. --- envsetup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/envsetup.sh b/envsetup.sh index 27348eb..34b236f 100755 --- a/envsetup.sh +++ b/envsetup.sh @@ -28,6 +28,7 @@ distrocheck() { 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 } installpackages() { @@ -40,6 +41,8 @@ installpackages() { elif [[ "$userdistro" == "OSX" ]]; then sudo port install vim zsh tmux git 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" ]]; then + sudo pkg_add -r vim zsh tmux git subversion most else die 'Your distro does not have a package manager supported by this script, exiting!' fi @@ -86,4 +89,7 @@ installpackages changeshell getdotfiles - +# To make zsh work properly in FreeBSD +if [[ "$userdistro" == "FreeBSD" ]]; then + exec zsh +fi