From 8f0e53db4cd212fd417f3257c4bbfe8a908ed145 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 16 Feb 2020 20:48:44 +0000 Subject: [PATCH] Update install.sh script --- install.sh | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 291784b..a8ea31d 100755 --- a/install.sh +++ b/install.sh @@ -122,20 +122,35 @@ install_dokku() { # Helper functions # +ok() { + printf "OK:\t%s\n" "$1" +} + +info() { + printf "INFO:\t%s\n" "$1" +} + symlink() { - if [ ! -e "$2" ]; then - echo " symlink: $2 --> $1" - ln -s "$1" "$2" + local source="$1" + local target="$2" + + if [ ! -e "$target" ]; then + ok "symlink: $target --> $source" + ln -s "$source" "$target" else - echo " exists: $2" + info "symlink: $target exists" fi } git_clone () { - if [ ! -e "$2" ]; then - git clone "$1" "$2" + local clone_url="$1" + local target="$2" + + if [ ! -e "$target" ]; then + git clone "$clone_url" "$target" + ok "git clone: $clone_url --> $target" else - echo "[ERROR] $2 already exists" + info "git clone: $target already exists" fi }