From 17ca90ded0609633153dbd1ea6e45ca4172a6f0a Mon Sep 17 00:00:00 2001 From: Martim Lobao Date: Fri, 8 Nov 2024 15:54:16 +0000 Subject: [PATCH] fix: Fix bug in dock.sh - fix bug introduced by lint fix --- bootstrap.sh | 4 ++-- dock.sh | 2 ++ linkme/.zprofile | 2 +- run.sh | 29 +++++++++++++++++------------ 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index c3e9ddf..4d6c785 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -19,11 +19,11 @@ if [[ ! -d ${DOTPATH} ]]; then if [[ -z ${BRANCH} ]]; then - echo -e "\033[1;33m🔗 Cloning dotfiles...\033[0m" + echo -e "\033[1;33m📑 Cloning dotfiles...\033[0m" git clone https://github.com/martimlobao/dotfiles.git "${DOTPATH}" echo -e "\033[1;32m✅ Cloned Dotfiles to ${DOTPATH}\033[0m" else - echo -e "\033[1;33m🔗 Cloning dotfiles on branch ${BRANCH}...\033[0m" + echo -e "\033[1;33m📑 Cloning dotfiles on branch ${BRANCH}...\033[0m" git clone https://github.com/martimlobao/dotfiles.git --branch "${BRANCH}" "${DOTPATH}" echo -e "\033[1;32m✅ Cloned Dotfiles to ${DOTPATH} on branch ${BRANCH}\033[0m" fi diff --git a/dock.sh b/dock.sh index 9d6f203..375b7d0 100755 --- a/dock.sh +++ b/dock.sh @@ -47,6 +47,7 @@ function add_folder_to_dock { # 2 -> Grid # 3 -> List folder_path="${1}" + shift # remove folder_path from args sortby="1" displayas="0" viewcontentas="0" @@ -72,6 +73,7 @@ function add_folder_to_dock { exit 1 ;; esac + shift # shift to next arg shift done diff --git a/linkme/.zprofile b/linkme/.zprofile index b91a64a..622315f 100644 --- a/linkme/.zprofile +++ b/linkme/.zprofile @@ -1,4 +1,4 @@ -if [[ ${CI} == "true" ]]; then +if [[ ${CI:-"false"} == "true" ]]; then # Exit on error for CI set -e fi diff --git a/run.sh b/run.sh index 0fac232..4487579 100755 --- a/run.sh +++ b/run.sh @@ -10,7 +10,6 @@ source "${root}/bash_traceback.sh" # OS and architecture detection # ############################################################################### os="$(uname)" -# If os is neither Linux or Darwin, exit 1 if [[ ${os} != 'Darwin' ]] && [[ ${os} != 'Linux' ]]; then echo -e "❌ \033[1;31mError: Unsupported OS: ${os}\033[0m" exit 1 @@ -40,8 +39,11 @@ echo -e "\033[1;33m🚀 Running dotsync.sh...\033[0m" sleep 1 ./dotsync.sh "${1-}" -# Linux is not supported after this point +############################################################################### +# Linux exit # +############################################################################### if [[ ${os} == "Linux" ]]; then + echo echo -e "\033[1;33m ⛔️ Warning: Linux is not supported after this point.\033[0m" exit 0 fi @@ -53,20 +55,15 @@ fi # echo -e "\033[1;33m🚀 Running macos.sh...\033[0m" # sudo ./macos.sh -# CI is not supported after this point -if [[ ${GITHUB_ACTIONS} == "true" ]]; then +############################################################################### +# CI exit # +############################################################################### +if [[ ${CI-} == "true" ]]; then + echo echo -e "\033[1;33m ⛔️ Warning: macOS is not supported in CI after this point.\033[0m" exit 0 fi -############################################################################### -# Local settings and variables # -############################################################################### -echo -echo -e "\033[1;33m🚀 Running local.sh...\033[0m" -sleep 1 -./local.sh "${1-}" - ############################################################################### # Install apps and software # ############################################################################### @@ -79,5 +76,13 @@ echo -e "\033[1;33m🚀 Running dock.sh...\033[0m" sleep 1 ./dock.sh +############################################################################### +# Local settings and variables # +############################################################################### +echo +echo -e "\033[1;33m🚀 Running local.sh...\033[0m" +sleep 1 +./local.sh "${1-}" + echo echo -e "\033[1;32m🎉 Setup complete!\033[0m"