Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ruby-build
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ruby-build
Commits
83728089
Commit
83728089
authored
Jan 29, 2013
by
Sam Stephenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Confirm reinstalling already-installed versions unless invoked with --force
parent
5fd4ec64
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
bin/rbenv-install
+19
-2
bin/rbenv-uninstall
+2
-2
No files found.
bin/rbenv-install
View file @
83728089
...
@@ -2,11 +2,12 @@
...
@@ -2,11 +2,12 @@
#
#
# Summary: Install a Ruby version using the ruby-build plugin
# Summary: Install a Ruby version using the ruby-build plugin
#
#
# Usage: rbenv install [-k|--keep] [-v|--verbose] <version>
# Usage: rbenv install [-
f|--force] [-
k|--keep] [-v|--verbose] <version>
# rbenv install [-
k|--keep] [-v|--verbose] /path/to/definition
# rbenv install [-
f|--force] [-k|--keep] [-v|--verbose] <definition-file>
# rbenv install -l|--list
# rbenv install -l|--list
#
#
# -l/--list List all available versions
# -l/--list List all available versions
# -f/--force Install even if the version appears to be installed already
# -k/--keep Keep source tree in $RBENV_BUILD_ROOT after installation
# -k/--keep Keep source tree in $RBENV_BUILD_ROOT after installation
# (defaults to $RBENV_ROOT/sources)
# (defaults to $RBENV_ROOT/sources)
# -v/--verbose Verbose mode: print compilation status to stdout
# -v/--verbose Verbose mode: print compilation status to stdout
...
@@ -36,6 +37,7 @@ usage() {
...
@@ -36,6 +37,7 @@ usage() {
[
-z
"
$1
"
]
||
exit
"
$1
"
[
-z
"
$1
"
]
||
exit
"
$1
"
}
}
unset
FORCE
unset
KEEP
unset
KEEP
unset
VERBOSE
unset
VERBOSE
...
@@ -50,6 +52,9 @@ for option in "${OPTIONS[@]}"; do
...
@@ -50,6 +52,9 @@ for option in "${OPTIONS[@]}"; do
ruby-build
--definitions
| sed
's/^/ /'
ruby-build
--definitions
| sed
's/^/ /'
exit
exit
;;
;;
"f"
|
"force"
)
FORCE
=
true
;;
"k"
|
"keep"
)
"k"
|
"keep"
)
[
-n
"
${
RBENV_BUILD_ROOT
}
"
]
||
RBENV_BUILD_ROOT
=
"
${
RBENV_ROOT
}
/sources"
[
-n
"
${
RBENV_BUILD_ROOT
}
"
]
||
RBENV_BUILD_ROOT
=
"
${
RBENV_ROOT
}
/sources"
;;
;;
...
@@ -102,6 +107,18 @@ done
...
@@ -102,6 +107,18 @@ done
[
-n
"
$VERSION_NAME
"
]
||
VERSION_NAME
=
"
${
DEFINITION
##*/
}
"
[
-n
"
$VERSION_NAME
"
]
||
VERSION_NAME
=
"
${
DEFINITION
##*/
}
"
PREFIX
=
"
${
RBENV_ROOT
}
/versions/
${
VERSION_NAME
}
"
PREFIX
=
"
${
RBENV_ROOT
}
/versions/
${
VERSION_NAME
}
"
# If the installation prefix exists, prompt for confirmation unless
# the --force option was specified.
if
[
-z
"
$FORCE
"
]
&&
[
-d
"
${
PREFIX
}
/bin"
]
;
then
echo
"rbenv:
$PREFIX
already exists"
>
&2
read
-p
"continue with installation? (y/N) "
case
"
$REPLY
"
in
y
*
|
Y
*
)
;;
*
)
exit
1
;;
esac
fi
# If RBENV_BUILD_ROOT is set, always pass keep options to ruby-build.
# If RBENV_BUILD_ROOT is set, always pass keep options to ruby-build.
if
[
-n
"
${
RBENV_BUILD_ROOT
}
"
]
;
then
if
[
-n
"
${
RBENV_BUILD_ROOT
}
"
]
;
then
export
RUBY_BUILD_BUILD_PATH
=
"
${
RBENV_BUILD_ROOT
}
/
${
VERSION_NAME
}
"
export
RUBY_BUILD_BUILD_PATH
=
"
${
RBENV_BUILD_ROOT
}
/
${
VERSION_NAME
}
"
...
...
bin/rbenv-uninstall
View file @
83728089
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#
#
# Summary: Uninstall a specific Ruby version
# Summary: Uninstall a specific Ruby version
#
#
# Usage: rbenv uninstall [-f] <version>
# Usage: rbenv uninstall [-f
|--force
] <version>
#
#
# -f Attempt to remove the specified version without prompting
# -f Attempt to remove the specified version without prompting
# for confirmation. If the version does not exist, do not
# for confirmation. If the version does not exist, do not
...
@@ -22,7 +22,7 @@ if [ -z "$RBENV_ROOT" ]; then
...
@@ -22,7 +22,7 @@ if [ -z "$RBENV_ROOT" ]; then
fi
fi
unset
FORCE
unset
FORCE
if
[
"
$1
"
=
"-f"
]
;
then
if
[
"
$1
"
=
"-f"
]
||
[
"
$1
"
=
"--force"
]
;
then
FORCE
=
true
FORCE
=
true
shift
shift
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment