File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 22
33set -e
44
5+ abs_dirname () {
6+ local cwd=" $( pwd) "
7+ local path=" $1 "
8+
9+ while [ -n " $path " ]; do
10+ cd " ${path%/* } "
11+ local name=" ${path##*/ } "
12+ path=" $( readlink " $name " || true) "
13+ done
14+
15+ pwd
16+ cd " $cwd "
17+ }
18+
519install_package () {
620 local cwd=" $( pwd) "
721 local package_name=" $1 "
@@ -96,12 +110,19 @@ usage() {
96110}
97111
98112
113+ RUBY_BUILD_ROOT=" $( abs_dirname " $0 " ) /.."
114+
99115DEFINITION_PATH=" $1 "
100116if [ -z " $DEFINITION_PATH " ]; then
101117 usage
102118elif [ ! -e " $DEFINITION_PATH " ]; then
103- echo " ruby-build: definition not found: ${DEFINITION_PATH} " >&2
104- exit 1
119+ BUILTIN_DEFINITION_PATH=" ${RUBY_BUILD_ROOT} /share/ruby-build/${DEFINITION_PATH} "
120+ if [ -e " $BUILTIN_DEFINITION_PATH " ]; then
121+ DEFINITION_PATH=" $BUILTIN_DEFINITION_PATH "
122+ else
123+ echo " ruby-build: definition not found: ${DEFINITION_PATH} " >&2
124+ exit 1
125+ fi
105126fi
106127
107128PREFIX_PATH=" $2 "
You can’t perform that action at this time.
0 commit comments