Permalink
Browse files

Ensure .bin directory exists in $HOME and in $PATH

  • Loading branch information...
1 parent 682323b commit c56f081af0969f60a87efc2d7d04947088d72444 @thcipriani thcipriani committed with Dan Collis-Puro Sep 5, 2013
Showing with 32 additions and 2 deletions.
  1. +1 −0 Manifest.linux
  2. +1 −0 Manifest.mac
  3. +8 −0 common-components/check-home-bin
  4. +11 −1 linux
  5. +1 −1 linux-components/rbenv
  6. +10 −0 mac
View
@@ -1,6 +1,7 @@
common-components/zsh-shebang
common-components/header
common-components/exit-trap
+common-components/check-home-bin
common-components/shared-functions
linux-components/distro-check
linux-components/debian-package-update
View
@@ -1,6 +1,7 @@
common-components/zsh-shebang
common-components/header
common-components/exit-trap
+common-components/check-home-bin
common-components/shared-functions
mac-components/zsh-fix
mac-components/homebrew
@@ -0,0 +1,8 @@
+if [ ! -d "$HOME/.bin/" ]; then
+ mkdir "$HOME/.bin"
+fi
+
+if [[ ":$PATH:" != *":$HOME/.bin:"* ]]; then
+ echo 'export PATH="$HOME/.bin:$PATH"' >> ~/.zshrc
+ source ~/.zshrc
+fi
View
12 linux
@@ -13,6 +13,16 @@ trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
set -e
### end common-components/exit-trap
+if [ ! -d "$HOME/.bin/" ]; then
+ mkdir "$HOME/.bin"
+fi
+
+if [[ ":$PATH:" != *":$HOME/.bin:"* ]]; then
+ echo 'export PATH="$HOME/.bin:$PATH"' >> ~/.zshrc
+ source ~/.zshrc
+fi
+### end common-components/check-home-bin
+
fancy_echo() {
echo "\n$1"
}
@@ -82,7 +92,7 @@ fancy_echo "Installing rbenv, to change Ruby versions ..."
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
if ! grep -qs "rbenv init" ~/.zshrc; then
- echo 'export PATH="$HOME/bin:$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
+ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
fi
View
@@ -2,7 +2,7 @@ fancy_echo "Installing rbenv, to change Ruby versions ..."
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
if ! grep -qs "rbenv init" ~/.zshrc; then
- echo 'export PATH="$HOME/bin:$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
+ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
fi
View
10 mac
@@ -13,6 +13,16 @@ trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
set -e
### end common-components/exit-trap
+if [ ! -d "$HOME/.bin/" ]; then
+ mkdir "$HOME/.bin"
+fi
+
+if [[ ":$PATH:" != *":$HOME/.bin:"* ]]; then
+ echo 'export PATH="$HOME/.bin:$PATH"' >> ~/.zshrc
+ source ~/.zshrc
+fi
+### end common-components/check-home-bin
+
fancy_echo() {
echo "\n$1"
}

0 comments on commit c56f081

Please sign in to comment.