aboutsummaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-09-08 00:43:05 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-09-08 00:43:05 +0200
commit13e99c30227cfe7452a687a21f3213b125301498 (patch)
treef3f3b32be60b7fb93806bea73d1776b4d910900a /install.sh
parent97a85d875127da7e1760c7dfb03e2a5f773448a9 (diff)
downloaddotfiles-13e99c30227cfe7452a687a21f3213b125301498.tar.gz
install.sh formatting
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh15
1 files changed, 6 insertions, 9 deletions
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