Created
August 9, 2014 03:21
-
-
Save parkr/8cffcd12bf7975eae1c8 to your computer and use it in GitHub Desktop.
Testing for-loop functionality of https://github.com/sstephenson/ruby-build/issues/609
This file contains 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
#!/usr/bin/env bash | |
DEFINITION_PATH="2.1.1-github" | |
RUBY_BUILD_DEFINITIONS="$HOME/code/rbenv-custom-definitions/support" | |
RUBY_BUILD_DEFINITIONS="/usr/local/share/ruby-build:${RUBY_BUILD_DEFINITIONS}" | |
echo "$RUBY_BUILD_DEFINITIONS" | tr ":" "\n" | sed '/^$/d' | while read DEFINITION_DIRECTORY; do | |
echo "Testing ${DEFINITION_DIRECTORY}/${DEFINITION_PATH}" | |
if [ -e "${DEFINITION_DIRECTORY}/${DEFINITION_PATH}" ]; then | |
echo "It worked!" | |
DEFINITION_PATH="${DEFINITION_DIRECTORY}/${DEFINITION_PATH}" | |
echo "New definition path: $DEFINITION_PATH" | |
break | |
fi | |
done | |
echo "Resulting definition path: $DEFINITION_PATH" |
This file contains 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
Testing /usr/local/share/ruby-build/2.1.1-github | |
Testing /Users/parker/code/rbenv-custom-definitions/support/2.1.1-github | |
It worked! | |
New definition path: /Users/parker/code/rbenv-custom-definitions/support/2.1.1-github | |
Resulting definition path: 2.1.1-github |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment