From 13e99c30227cfe7452a687a21f3213b125301498 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Tue, 8 Sep 2020 00:43:05 +0200 Subject: install.sh formatting --- install.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index c3488a8..7fc0ad3 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -#['name']='install location' +#['name']='install location relative to $HOME' declare -A CONFIGS CONFIGS=( ["sway"]=".config" ["alacritty"]=".config" @@ -30,8 +30,7 @@ SETS=( ["base"]=".vim .bashrc .bash_profile" #1: message -yes_no() -{ +yes_no() { read -p "$1 (y/[n])" inp case $inp in [yY]* ) return 0;; @@ -79,8 +78,7 @@ multiselector() { echo $ret } -selector() -{ +selector() { local regex="^-?[0-9]+\$" local cnt=0 for selection in "$@" @@ -103,8 +101,7 @@ selector() } #1: source 2: destination -link() -{ +link() { if [ -e $2 ]; then if yes_no "$(basename $2) exists. Overwrite?"; then if [ -d $2 ]; then @@ -120,7 +117,7 @@ link() ln -s "$1" "$2" } -choose_target(){ +choose_target() { if [ ! -z ${CONFIGS[$1]} ]; then echo "Install $(pwd)/$1 to $HOME/${CONFIGS[$1]}/$1" link "$(pwd)/$1" "$HOME/${CONFIGS[$1]}/$1" @@ -133,7 +130,7 @@ choose_target(){ fi } -housekeeping(){ +housekeeping() { git submodule init git submodule update -- cgit v1.2.3