diff --git a/install.sh b/install.sh index 54ab0f2d..0514971a 100755 --- a/install.sh +++ b/install.sh @@ -6,7 +6,7 @@ if [ ! -f "$HOME/.config/.jstm_dotfiles" ]; then ./uninstall.sh &> /dev/null fi -# useful function +# utility function function link() { if [ -a "${HOME}/${2}" ]; then [[ -n "$VERBOSE_WARNING" ]] && echo ":: Warning: ${2} already exists." @@ -17,20 +17,17 @@ function link() { } # update/clone repositories -if [ ! -d "dracula-mc" ]; then - git clone "https://github.com/dracula/midnight-commander.git" dracula-mc -else +[[ ! -d "dracula-mc" ]] && git clone "https://github.com/dracula/midnight-commander.git" dracula-mc +( cd dracula-mc git pull - cd .. -fi -if [ ! -d "jstmbash" ]; then - git clone "https://git.staropensource.de/JeremyStarTM/jstmbash.git" jstmbash -else +) + +[[ ! -d "jstmbash" ]] && git clone "https://git.staropensource.de/JeremyStarTM/jstmbash.git" jstmbash +( cd jstmbash git pull - cd .. -fi +) # create directories mkdir -p "${HOME}/.config" "${HOME}/.local/share/mc/skins" "${HOME}/.local/bin" diff --git a/uninstall.sh b/uninstall.sh index 34ffe8c9..8268aa7d 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,7 +1,7 @@ #!/bin/bash # jeremystartm's dotfiles "installer" -# useful function +# utility function function unlink() { if [ -a "${HOME}/${1}" ]; then echo ":: Unlinking ${1}"