mirror of
https://github.com/ViViDboarder/shoestrap.git
synced 2024-11-21 21:46:34 +00:00
Merge pull request #5 from dmahlow/sanitize_install_arguments
Sanitize is_installed/set_installed arguments.
This commit is contained in:
commit
a040041a98
@ -331,12 +331,8 @@ fail_if_not_root () {
|
|||||||
# Checks if a certain element has already been installed.
|
# Checks if a certain element has already been installed.
|
||||||
#
|
#
|
||||||
function is_installed () {
|
function is_installed () {
|
||||||
if [ $# -gt 1 ]; then
|
local args=$*
|
||||||
local args=$*
|
local name=${args//[ \/:@]/-}
|
||||||
local name=${args// /-}
|
|
||||||
else
|
|
||||||
local name=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -f ~/.shoestrap/installed/$name ]]; then
|
if [[ -f ~/.shoestrap/installed/$name ]]; then
|
||||||
log "'$name' is already installed."
|
log "'$name' is already installed."
|
||||||
@ -351,14 +347,9 @@ function is_installed () {
|
|||||||
# Sets an element as installed.
|
# Sets an element as installed.
|
||||||
#
|
#
|
||||||
function set_installed () {
|
function set_installed () {
|
||||||
if [ $# -gt 1 ]; then
|
local args=$*
|
||||||
local args=$*
|
local name=${args//[ \/:@]/-}
|
||||||
local name=${args// /-}
|
|
||||||
else
|
|
||||||
local name=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p ~/.shoestrap/installed
|
mkdir -p ~/.shoestrap/installed
|
||||||
touch ~/.shoestrap/installed/$name
|
touch ~/.shoestrap/installed/$name
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user