diff options
author | Denis Costa <deniscostadsc@gmail.com> | 2016-03-15 09:58:34 -0300 |
---|---|---|
committer | Denis Costa <deniscostadsc@gmail.com> | 2016-03-15 09:58:34 -0300 |
commit | b42467d84a0bce4d4ee14e3ae633eaaed1cf9588 (patch) | |
tree | 0c42f4a153df882d49b0448209ab0a1937e13685 | |
parent | cf32471caf75b817b23339166002987726d3d6d8 (diff) | |
parent | a455353a811d4cf3a9c327750e9d0fb4c7ee229a (diff) |
Merge pull request #629 from jnews0n/master
Determine user's configured shell then set variable accordingly. #624 @jnews0n / kafkas_sonnet
-rw-r--r-- | osx_setup.sh | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/osx_setup.sh b/osx_setup.sh index a8a37833..d042d045 100644 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -1,5 +1,35 @@ #!/bin/bash +# Test to make sure we are OSX +if [ $(uname) != 'Darwin' ] +then + echo "This script should run only on an OSX system!" + exit 1 +fi + +# Read the shell configured for the user and set the variable file accordingly +function current_shell { + case $SHELL in + *bash) + echo ~/.bash_profile + ;; + + *zsh) + echo ~/.zprofile + ;; + + /bin/sh) + echo ~/.profile + ;; + + *) + echo "Your shell isn't supported yet!" + ;; + + #Other shells can go here + esac +} + function install_compass { rbenv install -s 2.2.3 eval "$(rbenv init -)" @@ -7,8 +37,8 @@ function install_compass { rbenv local 2.2.3 gem install compass export PATH=$PATH:~/.rbenv/versions/2.2.3/bin - echo "export PATH=$PATH:~/.rbenv/versions/2.2.3/bin" >> ~/.bash_profile - echo 'eval "$(rbenv init -)"' >> ~/.bash_profile + echo "export PATH=$PATH:~/.rbenv/versions/2.2.3/bin" >> $(current_shell) + echo 'eval "$(rbenv init -)"' >> $(current_shell) } function install_rbenv { @@ -30,13 +60,14 @@ function clone_repo { cd pixelated-user-agent fi } + #setup frontend install_rbenv install_compass install_npm #setup backend -brew install python # force brew install even if python is already installed +brew install python # force brew install even if python is already install export LDFLAGS=-L/usr/local/opt/openssl/lib export LDFLAGS=-L/usr/local/opt/openssl/lib pip install virtualenv |