From 47df3a86d7cf412d766f8a1fdd1e9b9fe15bfb45 Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Wed, 24 Feb 2016 18:52:34 +1100 Subject: Determine user's configured shell then set variable accordingly. #624 --- osx_setup.sh | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) mode change 100644 => 100755 osx_setup.sh diff --git a/osx_setup.sh b/osx_setup.sh old mode 100644 new mode 100755 index a8a37833..22d68836 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -1,5 +1,21 @@ -#!/bin/bash +#!/usr/bin/env bash -x +# Test to make sure we are OSX +if [ `/usr/bin/env | grep system_name | awk -F= '{print $2}'` != 'OSX' ] + then + exit $? +fi + +# Read the shell configured for the user and set the variable file accordingly +if [ `dscl . read ~ UserShell | grep -c bash` -eq 1 ] + then + usershellvars='~/.bash_profile' +elif [ `dscl . read ~ UserShell | grep -c zsh` -eq 1 ] + then + usershellvars='~/.zshrc' + +fi + function install_compass { rbenv install -s 2.2.3 eval "$(rbenv init -)" @@ -7,8 +23,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" >> $usershellvars + echo 'eval "$(rbenv init -)"' >> $usershellvars } function install_rbenv { @@ -30,10 +46,11 @@ function clone_repo { cd pixelated-user-agent fi } + #setup frontend -install_rbenv -install_compass -install_npm + install_rbenv + install_compass + install_npm #setup backend brew install python # force brew install even if python is already installed -- cgit v1.2.3 From 52467b9aef76c9aac2f250478befd3afb7b6aabd Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Thu, 25 Feb 2016 07:45:06 +1100 Subject: Remove shell switch from testing. --- osx_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osx_setup.sh b/osx_setup.sh index 22d68836..e90ae5f8 100755 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash -x +#!/usr/bin/env bash # Test to make sure we are OSX if [ `/usr/bin/env | grep system_name | awk -F= '{print $2}'` != 'OSX' ] -- cgit v1.2.3 From 739e5df4094e4965241762bc3579d3ad6cebe0ce Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Mon, 29 Feb 2016 10:11:08 +1100 Subject: #624 - Modify changes and apply suggested style. Get current running shell and determine .rc file accordingly. --- osx_setup.sh | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) mode change 100755 => 100644 osx_setup.sh diff --git a/osx_setup.sh b/osx_setup.sh old mode 100755 new mode 100644 index e90ae5f8..a8a37833 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -1,21 +1,5 @@ -#!/usr/bin/env bash +#!/bin/bash -# Test to make sure we are OSX -if [ `/usr/bin/env | grep system_name | awk -F= '{print $2}'` != 'OSX' ] - then - exit $? -fi - -# Read the shell configured for the user and set the variable file accordingly -if [ `dscl . read ~ UserShell | grep -c bash` -eq 1 ] - then - usershellvars='~/.bash_profile' -elif [ `dscl . read ~ UserShell | grep -c zsh` -eq 1 ] - then - usershellvars='~/.zshrc' - -fi - function install_compass { rbenv install -s 2.2.3 eval "$(rbenv init -)" @@ -23,8 +7,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" >> $usershellvars - echo 'eval "$(rbenv init -)"' >> $usershellvars + echo "export PATH=$PATH:~/.rbenv/versions/2.2.3/bin" >> ~/.bash_profile + echo 'eval "$(rbenv init -)"' >> ~/.bash_profile } function install_rbenv { @@ -46,11 +30,10 @@ function clone_repo { cd pixelated-user-agent fi } - #setup frontend - install_rbenv - install_compass - install_npm +install_rbenv +install_compass +install_npm #setup backend brew install python # force brew install even if python is already installed -- cgit v1.2.3 From 2662e78497ce527467556a15c3cc9b20f84929ba Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Mon, 29 Feb 2016 10:29:33 +1100 Subject: Update osx_setup.sh Address issue #624 and apply suggested coding style. --- osx_setup.sh | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/osx_setup.sh b/osx_setup.sh index e90ae5f8..2103d765 100755 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -1,21 +1,27 @@ -#!/usr/bin/env bash +#!/bin/bash # Test to make sure we are OSX -if [ `/usr/bin/env | grep system_name | awk -F= '{print $2}'` != 'OSX' ] - then - exit $? +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 -if [ `dscl . read ~ UserShell | grep -c bash` -eq 1 ] - then - usershellvars='~/.bash_profile' -elif [ `dscl . read ~ UserShell | grep -c zsh` -eq 1 ] - then - usershellvars='~/.zshrc' +function current_shell { + case $SHELL in + *bash) + echo ~/.bash_profile + ;; + + *zsh) + echo ~/.zshrc + ;; + + #Other shells can go here + esac +} -fi - function install_compass { rbenv install -s 2.2.3 eval "$(rbenv init -)" @@ -23,8 +29,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" >> $usershellvars - echo 'eval "$(rbenv init -)"' >> $usershellvars + echo "export PATH=$PATH:~/.rbenv/versions/2.2.3/bin" >> $(current_shell) + echo 'eval "$(rbenv init -)"' >> $(current_shell) } function install_rbenv { @@ -48,12 +54,12 @@ function clone_repo { } #setup frontend - install_rbenv - install_compass - install_npm +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 -- cgit v1.2.3 From 275f564efe0168d50135e1d6d7d26b916b936b12 Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Fri, 4 Mar 2016 10:59:07 +1100 Subject: Determine user's configured shell then set variable accordingly. #624 --- osx_setup.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/osx_setup.sh b/osx_setup.sh index 2103d765..c58270c7 100755 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -3,23 +3,28 @@ # Test to make sure we are OSX if [ $(uname) != 'Darwin' ] then - echo "This script should run only on an OSX system!" - exit 1 + 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 - ;; + case $SHELL in + *bash) + echo ~/.bash_profile + ;; - *zsh) - echo ~/.zshrc - ;; + *zsh) + echo ~/.zprofile + ;; + + /bin/sh + echo ~/.profile + ;; + #Other shells can go here - esac + esac } function install_compass { -- cgit v1.2.3 From 5dfe6202e34974c120a240822b57ed020933a640 Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Fri, 4 Mar 2016 13:45:04 +1100 Subject: Issue #624 --- osx_setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osx_setup.sh b/osx_setup.sh index c58270c7..ad330f18 100755 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -17,15 +17,15 @@ function current_shell { *zsh) echo ~/.zprofile ;; - + /bin/sh echo ~/.profile ;; - - #Other shells can go here + + #Other shells can go here esac -} +} function install_compass { rbenv install -s 2.2.3 -- cgit v1.2.3 From fca026810e24e78c0c2661963a6f68351410f677 Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Wed, 24 Feb 2016 18:52:34 +1100 Subject: Determine user's configured shell then set variable accordingly. #624 --- osx_setup.sh | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) mode change 100644 => 100755 osx_setup.sh diff --git a/osx_setup.sh b/osx_setup.sh old mode 100644 new mode 100755 index a8a37833..22d68836 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -1,5 +1,21 @@ -#!/bin/bash +#!/usr/bin/env bash -x +# Test to make sure we are OSX +if [ `/usr/bin/env | grep system_name | awk -F= '{print $2}'` != 'OSX' ] + then + exit $? +fi + +# Read the shell configured for the user and set the variable file accordingly +if [ `dscl . read ~ UserShell | grep -c bash` -eq 1 ] + then + usershellvars='~/.bash_profile' +elif [ `dscl . read ~ UserShell | grep -c zsh` -eq 1 ] + then + usershellvars='~/.zshrc' + +fi + function install_compass { rbenv install -s 2.2.3 eval "$(rbenv init -)" @@ -7,8 +23,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" >> $usershellvars + echo 'eval "$(rbenv init -)"' >> $usershellvars } function install_rbenv { @@ -30,10 +46,11 @@ function clone_repo { cd pixelated-user-agent fi } + #setup frontend -install_rbenv -install_compass -install_npm + install_rbenv + install_compass + install_npm #setup backend brew install python # force brew install even if python is already installed -- cgit v1.2.3 From cef05d5a6674f7343caa7a1a19024fda5c725e9c Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Thu, 25 Feb 2016 07:45:06 +1100 Subject: Remove shell switch from testing. --- osx_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osx_setup.sh b/osx_setup.sh index 22d68836..e90ae5f8 100755 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash -x +#!/usr/bin/env bash # Test to make sure we are OSX if [ `/usr/bin/env | grep system_name | awk -F= '{print $2}'` != 'OSX' ] -- cgit v1.2.3 From 55b0390eaee7d2a4b66900e7a1fddf1a286ff834 Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Mon, 29 Feb 2016 10:29:33 +1100 Subject: Update osx_setup.sh Address issue #624 and apply suggested coding style. --- osx_setup.sh | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/osx_setup.sh b/osx_setup.sh index e90ae5f8..2103d765 100755 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -1,21 +1,27 @@ -#!/usr/bin/env bash +#!/bin/bash # Test to make sure we are OSX -if [ `/usr/bin/env | grep system_name | awk -F= '{print $2}'` != 'OSX' ] - then - exit $? +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 -if [ `dscl . read ~ UserShell | grep -c bash` -eq 1 ] - then - usershellvars='~/.bash_profile' -elif [ `dscl . read ~ UserShell | grep -c zsh` -eq 1 ] - then - usershellvars='~/.zshrc' +function current_shell { + case $SHELL in + *bash) + echo ~/.bash_profile + ;; + + *zsh) + echo ~/.zshrc + ;; + + #Other shells can go here + esac +} -fi - function install_compass { rbenv install -s 2.2.3 eval "$(rbenv init -)" @@ -23,8 +29,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" >> $usershellvars - echo 'eval "$(rbenv init -)"' >> $usershellvars + echo "export PATH=$PATH:~/.rbenv/versions/2.2.3/bin" >> $(current_shell) + echo 'eval "$(rbenv init -)"' >> $(current_shell) } function install_rbenv { @@ -48,12 +54,12 @@ function clone_repo { } #setup frontend - install_rbenv - install_compass - install_npm +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 -- cgit v1.2.3 From 5bf92fac1a709b336e44e29d53981b9953cdccbe Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Fri, 4 Mar 2016 10:59:07 +1100 Subject: Determine user's configured shell then set variable accordingly. #624 --- osx_setup.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/osx_setup.sh b/osx_setup.sh index 2103d765..c58270c7 100755 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -3,23 +3,28 @@ # Test to make sure we are OSX if [ $(uname) != 'Darwin' ] then - echo "This script should run only on an OSX system!" - exit 1 + 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 - ;; + case $SHELL in + *bash) + echo ~/.bash_profile + ;; - *zsh) - echo ~/.zshrc - ;; + *zsh) + echo ~/.zprofile + ;; + + /bin/sh + echo ~/.profile + ;; + #Other shells can go here - esac + esac } function install_compass { -- cgit v1.2.3 From fe36ba50dd73553525aaff88e69e83e6855f3a98 Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Fri, 4 Mar 2016 13:45:04 +1100 Subject: Issue #624 --- osx_setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osx_setup.sh b/osx_setup.sh index c58270c7..ad330f18 100755 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -17,15 +17,15 @@ function current_shell { *zsh) echo ~/.zprofile ;; - + /bin/sh echo ~/.profile ;; - - #Other shells can go here + + #Other shells can go here esac -} +} function install_compass { rbenv install -s 2.2.3 -- cgit v1.2.3 From c049867c42ad4766811147f99036e2b3c30185f8 Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Sun, 6 Mar 2016 16:45:54 +1100 Subject: Issue #624 - detect osx shell --- osx_setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osx_setup.sh b/osx_setup.sh index ad330f18..60c4aa35 100755 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -22,7 +22,9 @@ function current_shell { echo ~/.profile ;; - + *) + echo "Your shell isn't supported yet!" + ;; #Other shells can go here esac } -- cgit v1.2.3 From fdc7b5aac56b40f49bba813f30b701be22d16c01 Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Sun, 6 Mar 2016 17:16:46 +1100 Subject: Issue #624 --- osx_setup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osx_setup.sh b/osx_setup.sh index f9827778..d78e8f0e 100755 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -11,15 +11,15 @@ fi function current_shell { case $SHELL in *bash) - echo ~/.bash_profile + echo ~/.bash_profile ;; *zsh) - echo ~/.zprofile + echo ~/.zprofile ;; - - /bin/sh - echo ~/.profile + + /bin/sh) + echo ~/.profile ;; *) @@ -28,7 +28,7 @@ function current_shell { #Other shells can go here esac -} +} function install_compass { rbenv install -s 2.2.3 -- cgit v1.2.3 From 0ffeb6b70df00a54a2509179c32104bc7f883196 Mon Sep 17 00:00:00 2001 From: Jon Newson Date: Sat, 12 Mar 2016 11:24:55 +1100 Subject: Issue #624 - Removed repeated lines. --- osx_setup.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/osx_setup.sh b/osx_setup.sh index f899b227..d042d045 100644 --- a/osx_setup.sh +++ b/osx_setup.sh @@ -39,8 +39,6 @@ function install_compass { export PATH=$PATH:~/.rbenv/versions/2.2.3/bin echo "export PATH=$PATH:~/.rbenv/versions/2.2.3/bin" >> $(current_shell) echo 'eval "$(rbenv init -)"' >> $(current_shell) - echo "export PATH=$PATH:~/.rbenv/versions/2.2.3/bin" >> $(current_shell) - echo 'eval "$(rbenv init -)"' >> $(current_shell) } function install_rbenv { -- cgit v1.2.3