Sanitize is_installed/set_installed arguments.

This commit is contained in:
Daniel Mahlow 2013-03-30 14:23:43 +01:00
parent 88fdfee202
commit cfe26e4cb5

View File

@ -331,12 +331,8 @@ fail_if_not_root () {
# Checks if a certain element has already been installed.
#
function is_installed () {
if [ $# -gt 1 ]; then
local args=$*
local name=${args// /-}
else
local name=$1
fi
local name=${args//[ \/:@]/-}
if [[ -f ~/.shoestrap/installed/$name ]]; then
log "'$name' is already installed."
@ -351,14 +347,9 @@ function is_installed () {
# Sets an element as installed.
#
function set_installed () {
if [ $# -gt 1 ]; then
local args=$*
local name=${args// /-}
else
local name=$1
fi
local name=${args//[ \/:@]/-}
mkdir -p ~/.shoestrap/installed
touch ~/.shoestrap/installed/$name
}