Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue in run_guard when there is a space in the project directory name #19

Merged
merged 1 commit into from Feb 28, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions run_guard.sh
Expand Up @@ -31,7 +31,7 @@ function load_rvm_as_a_function() {

function run_guard() {
printf "Running 'bundle exec guard'. All output/failures from this point on is from the 'bundle exec guard' command.\n\n"
cd $1 && bundle exec guard
cd "$1" && bundle exec guard
}

echo "\n\nStarting Guard for $1"
Expand All @@ -40,21 +40,21 @@ load_rvm_as_a_function
if [ $? -ne 0 ]; then # failed to load rvm
printf "Couldn't find or load RVM.\n"
printf "Attempting to run Guard using your system gemset.\n"
run_guard $1
run_guard "$1"
else # successfully loaded rvm
printf "Found and Successfully loaded RVM as a function.\n"
if [ -e "$1/.rvmrc" ]; then # found project specific .rvmrc
printf "Found an .rvmrc in the project directory. Trying to load it...\n"

cd $1
rvm rvmrc load $1
cd "$1"
rvm rvmrc load "$1"
if [ $? -ne 0 ]; then # failed to load project specific .rvmrc
printf "Failed to load the project .rvmrc\n"
printf "\nWE DID NOT RUN GUARD AS LOADING YOUR PROJECT SPECIFIC .rvmrc SHOULD NOT HAVE FAILED\n"
return 1
else # successfully loaded project specific .rvmrc
printf "Successfully loaded the project .rvmrc\n"
run_guard $1
run_guard "$1"
fi
else # failed to find project specific .rvmrc
printf "Failed to find a project specific .rvmrc in $1.\n"
Expand All @@ -67,7 +67,7 @@ else # successfully loaded rvm
return 1
else # successfully switched to the users default gemset
printf "Successfully switched to your default RVM environment.\n"
run_guard $1
run_guard "$1"
fi
fi
fi
Expand Down