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
aee47820
Commit
aee47820
authored
Aug 14, 2012
by
Sam Stephenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rbenv-uninstall prompts before removal unless invoked with -f
parent
6d4af030
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
13 deletions
+32
-13
bin/rbenv-uninstall
+32
-13
No files found.
bin/rbenv-uninstall
View file @
aee47820
...
@@ -3,24 +3,32 @@ set -e
...
@@ -3,24 +3,32 @@ set -e
# Provide rbenv completions
# Provide rbenv completions
if
[
"
$1
"
=
"--complete"
]
;
then
if
[
"
$1
"
=
"--complete"
]
;
then
exec
r
uby-build
--definitions
exec
r
benv versions
--bare
fi
fi
if
[
-z
"
$RBENV_ROOT
"
]
;
then
if
[
-z
"
$RBENV_ROOT
"
]
;
then
RBENV_ROOT
=
"
${
HOME
}
/.rbenv"
RBENV_ROOT
=
"
${
HOME
}
/.rbenv"
fi
fi
if
[
"
$1
"
=
"-f"
]
;
then
FORCE
=
1
shift
else
FORCE
=
""
fi
DEFINITION
=
"
$1
"
DEFINITION
=
"
$1
"
case
"
$DEFINITION
"
in
case
"
$DEFINITION
"
in
""
|
-
*
)
""
|
-
*
)
{
echo
"usage: rbenv uninstall VERSION"
{
echo
"usage: rbenv uninstall [-f] VERSION"
echo
" rbenv uninstall /path/to/definition"
echo
echo
" -f Attempt to remove the specified version without prompting"
echo
" for confirmation. If the version does not exist, do not"
echo
" display an error message."
echo
echo
"Available versions:"
rbenv versions
--bare
| sed
's/^/ /'
echo
echo
if
[
-n
`
which rbenv
`
]
;
then
echo
"Available versions:"
rbenv versions | sed
's/^/ /'
echo
fi
}
>
&2
}
>
&2
exit
1
exit
1
;;
;;
...
@@ -29,9 +37,20 @@ esac
...
@@ -29,9 +37,20 @@ esac
VERSION_NAME
=
"
${
DEFINITION
##*/
}
"
VERSION_NAME
=
"
${
DEFINITION
##*/
}
"
PREFIX
=
"
${
RBENV_ROOT
}
/versions/
${
VERSION_NAME
}
"
PREFIX
=
"
${
RBENV_ROOT
}
/versions/
${
VERSION_NAME
}
"
if
[
!
-e
"
$PREFIX
"
]
;
then
if
[
-z
"
$FORCE
"
]
;
then
echo
"Given version (
$VERSION_NAME
) is not installed"
if
[
!
-d
"
$PREFIX
"
]
;
then
exit
1
echo
"rbenv: version
\`
$VERSION_NAME
' not installed"
>
&2
exit
1
fi
read
-p
"rbenv: remove
$PREFIX
? "
case
"
$REPLY
"
in
y
*
|
Y
*
)
;;
*
)
exit
1
;;
esac
fi
if
[
-d
"
$PREFIX
"
]
;
then
rm
-rf
"
$PREFIX
"
rbenv rehash
fi
fi
rm
-rf
"
$PREFIX
"
rbenv rehash
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