mirror of
https://github.com/rbenv/ruby-build.git
synced 2024-12-29 13:15:33 +01:00
rbenv install: error out instead of prompting in non-interactive mode
This commit is contained in:
parent
b99755bf05
commit
81eed6c48e
2 changed files with 9 additions and 0 deletions
|
@ -178,6 +178,10 @@ PREFIX="${RBENV_ROOT}/versions/${VERSION_NAME}"
|
|||
if [ -d "${PREFIX}/bin" ]; then
|
||||
if [ -z "$FORCE" ] && [ -z "$SKIP_EXISTING" ]; then
|
||||
echo "rbenv: $PREFIX already exists" >&2
|
||||
if [ ! -t 0 ]; then
|
||||
echo "rbenv: must use \`--force' or \`--skip-existing' in non-interactive mode" >&2
|
||||
exit 1
|
||||
fi
|
||||
read -rp "continue with installation? (y/N) "
|
||||
|
||||
case "$REPLY" in
|
||||
|
|
|
@ -69,6 +69,11 @@ if [ -z "$FORCE" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -t 0 ]; then
|
||||
echo "rbenv: must use \`--force' in non-interactive mode" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -p "rbenv: remove $PREFIX? [yN] "
|
||||
case "$REPLY" in
|
||||
y* | Y* ) ;;
|
||||
|
|
Loading…
Reference in a new issue