-
-
Save robhurring/c59f30e37d9550a8878f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e # works without this | |
set -x # debug | |
source "$HOME/.rvm/scripts/rvm" #so 'cd' will change gemset when dotfiles present | |
#setup | |
rm -rf ~/tmp/dir_with_gemfile | |
mkdir -p ~/tmp/dir_with_gemfile | |
echo "source 'https://rubygems.org'" > ~/tmp/dir_with_gemfile/Gemfile | |
echo "gem 'rails'" >> ~/tmp/dir_with_gemfile/Gemfile | |
#end setup | |
#works | |
echo 'pre cd ~' | |
cd ~ | |
echo 'post cd ~' | |
#exits after "cd" | |
echo 'pre cd ~/tmp/dir_with_gemfile' | |
cd ~/tmp/dir_with_gemfile | |
echo 'post cd ~/tmp/dir_with_gemfile' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>./broken_cd.sh | |
pre cd ~ | |
post cd ~ | |
pre cd ~/tmp/dir_with_gemfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment