Use 'local' for function arguments
parent
4e928c2306
commit
8adb4a2add
15
.bin/setup
15
.bin/setup
|
@ -75,11 +75,12 @@ xbanish
|
|||
)
|
||||
|
||||
install() {
|
||||
if pacman -Qi "$1" &> /dev/null; then
|
||||
echo "$1 is already installed"
|
||||
local package="$1"
|
||||
if pacman -Qi "$package" &> /dev/null; then
|
||||
echo "$package is already installed"
|
||||
else
|
||||
echo "Installing " "$1"
|
||||
sudo pacman -S --noconfirm --needed "$1"
|
||||
echo "Installing " "$package"
|
||||
sudo pacman -S --noconfirm --needed "$package"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -179,13 +180,15 @@ setup_docker() {
|
|||
}
|
||||
|
||||
announce() {
|
||||
local message="$1"
|
||||
echo " "
|
||||
echo "[dots] $1"
|
||||
echo "[dots] $message"
|
||||
echo " "
|
||||
}
|
||||
|
||||
confirm() {
|
||||
read -r -p "[dots] $1? [y/N]" -n 1
|
||||
local question="$1"
|
||||
read -r -p "[dots] $question? [y/N]" -n 1
|
||||
case "$REPLY" in y|Y ) "$2";; * ) echo "Skipping"; esac
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue