diff --git a/add-submodules.sh b/add-submodules.sh index 96e7f25..29efd66 100755 --- a/add-submodules.sh +++ b/add-submodules.sh @@ -48,6 +48,7 @@ _log() { else echo " [ok] $1" fi + return 0 } remove_old_submodule() { diff --git a/config/shared.sh b/config/shared.sh index 309444e..67c7330 100755 --- a/config/shared.sh +++ b/config/shared.sh @@ -36,6 +36,7 @@ x-path-prepend() exit 1 ;; esac + return 0 } # Function to set environment variables based on the shell @@ -55,6 +56,7 @@ x-set-env() exit 1 ;; esac + return 0 } # Explicitly set XDG folders, if not already set @@ -149,6 +151,7 @@ if ! declare -f array_diff > /dev/null; then eval local ARR2=\(\"\${$3[@]}\"\) local IFS=$'\n' mapfile -t "$1" < <(comm -23 <(echo "${ARR1[*]}" | sort) <(echo "${ARR2[*]}" | sort)) + return 0 } fi diff --git a/config/tmux/sesh.sh b/config/tmux/sesh.sh index 0f2d32e..d0371b1 100755 --- a/config/tmux/sesh.sh +++ b/config/tmux/sesh.sh @@ -22,6 +22,7 @@ pick_with_gum() { --placeholder 'Pick a sesh' \ --height 50 \ --prompt='⚡' + return 0 } FZF_COMMON_OPTS=( @@ -42,10 +43,12 @@ FZF_COMMON_OPTS=( pick_with_fzf_tmux() { sesh list --icons | fzf-tmux -p 80%,70% "${FZF_COMMON_OPTS[@]}" + return 0 } pick_with_fzf() { sesh list --icons | fzf "${FZF_COMMON_OPTS[@]}" + return 0 } pick_with_select() { diff --git a/scripts/create-nvim-keymaps.sh b/scripts/create-nvim-keymaps.sh index ad31a7f..d9033cc 100755 --- a/scripts/create-nvim-keymaps.sh +++ b/scripts/create-nvim-keymaps.sh @@ -28,6 +28,7 @@ main() && mv "${DEST}.tmp" "$DEST" msg "Neovim keybindings documentation generated at $DEST" + return 0 } main "$@" diff --git a/scripts/create-wezterm-keymaps.sh b/scripts/create-wezterm-keymaps.sh index 44c8cfc..8418e28 100755 --- a/scripts/create-wezterm-keymaps.sh +++ b/scripts/create-wezterm-keymaps.sh @@ -20,6 +20,7 @@ main() printf "\`\`\`\n\n- Generated on %s\n" "$(date)" >> "$DEST" msg "wezterm keybindings documentation generated at $DEST" + return 0 } main "$@" diff --git a/scripts/install-apt-packages.sh b/scripts/install-apt-packages.sh index a956b24..d35487f 100755 --- a/scripts/install-apt-packages.sh +++ b/scripts/install-apt-packages.sh @@ -64,12 +64,14 @@ install_packages() else msgr ok "All packages already installed" fi + return 0 } main() { install_packages msgr yay "apt package installations complete" + return 0 } main "$@" diff --git a/scripts/install-cargo-packages.sh b/scripts/install-cargo-packages.sh index 332ce5c..7f4d8b1 100755 --- a/scripts/install-cargo-packages.sh +++ b/scripts/install-cargo-packages.sh @@ -57,6 +57,7 @@ install_packages() msgr run_done "Done installing $pkg" echo "" done + return 0 } # Function to perform additional steps for installed cargo packages @@ -72,6 +73,7 @@ post_install_steps() msgr run "Removing cargo cache" cargo cache --autoclean msgr "done" "Done removing cargo cache" + return 0 } main() @@ -79,6 +81,7 @@ main() install_packages msgr "done" "Installed cargo packages!" post_install_steps + return 0 } main "$@" diff --git a/scripts/install-cheat-purebashbible.sh b/scripts/install-cheat-purebashbible.sh index 5759be1..21dbe84 100755 --- a/scripts/install-cheat-purebashbible.sh +++ b/scripts/install-cheat-purebashbible.sh @@ -20,6 +20,7 @@ check_required_tools() exit 1 fi done + return 0 } clone_or_update_repo() @@ -34,6 +35,7 @@ clone_or_update_repo() git -C "$PBB_TEMP_DIR" pull -q \ && msgr yay "Updated $PBB_GIT" fi + return 0 } prepare_cheat_dest() @@ -46,6 +48,7 @@ prepare_cheat_dest() fi echo "$cheat_dest" + return 0 } # Processes chapter files from the pure-bash-bible repository and generates or updates corresponding cheat sheets. @@ -89,6 +92,7 @@ process_chapters() printf '%s\n%b%s\n%s' "---" "$metadata" "---" "$(cat "$cheat_file")" > "$cheat_file" fi done + return 0 } main() @@ -96,6 +100,7 @@ main() check_required_tools clone_or_update_repo process_chapters + return 0 } main "$@" diff --git a/scripts/install-dnf-packages.sh b/scripts/install-dnf-packages.sh index 7e947c7..6d52665 100755 --- a/scripts/install-dnf-packages.sh +++ b/scripts/install-dnf-packages.sh @@ -47,6 +47,7 @@ install_dev_tools_group() msgr run "Installing @development-tools group" sudo dnf group install -y "Development Tools" fi + return 0 } install_packages() @@ -71,6 +72,7 @@ install_packages() else msgr ok "All packages already installed" fi + return 0 } main() @@ -78,6 +80,7 @@ main() install_dev_tools_group install_packages msgr yay "dnf package installations complete" + return 0 } main "$@" diff --git a/scripts/install-fonts.sh b/scripts/install-fonts.sh index aa6eff8..4ae5a1c 100755 --- a/scripts/install-fonts.sh +++ b/scripts/install-fonts.sh @@ -23,6 +23,7 @@ clone_or_update_repo() fi cd "$TMP_PATH" || { msgr err "No such folder $TMP_PATH"; exit 1; } + return 0 } # Function to add fonts to sparse-checkout @@ -38,6 +39,7 @@ add_fonts_to_sparse_checkout() git sparse-checkout add "patched-fonts/$font" echo "" done + return 0 } # Function to install NerdFonts @@ -47,11 +49,13 @@ install_fonts() # shellcheck disable=SC2048,SC2086 ./install.sh -q -s ${fonts[*]} msgr run_done "Done" + return 0 } remove_tmp_path() { rm -rf "$TMP_PATH" + return 0 } main() @@ -60,6 +64,7 @@ main() add_fonts_to_sparse_checkout install_fonts remove_tmp_path + return 0 } main "$@" diff --git a/scripts/install-gh-extensions.sh b/scripts/install-gh-extensions.sh index d3a6d25..ff4a153 100755 --- a/scripts/install-gh-extensions.sh +++ b/scripts/install-gh-extensions.sh @@ -45,12 +45,14 @@ install_extensions() gh extension install "$ext" echo "" done + return 0 } main() { install_extensions msgr run_done "Done" + return 0 } main "$@" diff --git a/scripts/install-go-packages.sh b/scripts/install-go-packages.sh index 0e4e6b9..0b5c05c 100755 --- a/scripts/install-go-packages.sh +++ b/scripts/install-go-packages.sh @@ -33,6 +33,7 @@ install_packages() go install "$pkg" echo "" done + return 0 } # Function to install completions and run actions for selected packages @@ -44,6 +45,7 @@ post_install() git-profile completion zsh > "$ZSH_CUSTOM_COMPLETION_PATH/_git-profile" \ && msgr run_done "Installed completions for git-profile" fi + return 0 } # Function to clear go cache @@ -51,6 +53,7 @@ clear_go_cache() { msgr run "Clearing go cache" go clean -cache -modcache + return 0 } main() @@ -59,6 +62,7 @@ main() post_install clear_go_cache msgr run_done "Done" + return 0 } main "$@" diff --git a/scripts/install-npm-packages.sh b/scripts/install-npm-packages.sh index 5ffaf2c..c12495d 100755 --- a/scripts/install-npm-packages.sh +++ b/scripts/install-npm-packages.sh @@ -36,6 +36,7 @@ install_packages() fi echo "" done + return 0 } # Function to upgrade all global npm packages @@ -44,6 +45,7 @@ upgrade_global_packages() msgr run "Upgrading all global packages" npm -g --no-progress --no-timing --no-fund outdated npm -g --no-timing --no-fund upgrade + return 0 } # Function to clean npm cache @@ -53,6 +55,7 @@ clean_npm_cache() npm cache verify npm cache clean --force npm cache verify + return 0 } main() @@ -61,6 +64,7 @@ main() upgrade_global_packages clean_npm_cache msgr yay "npm package installations complete" + return 0 } main "$@" diff --git a/scripts/install-ntfy.sh b/scripts/install-ntfy.sh index 1dcadd2..8d48d6b 100755 --- a/scripts/install-ntfy.sh +++ b/scripts/install-ntfy.sh @@ -46,12 +46,14 @@ install_ntfy() if [[ ! -f "$HOME/.config/ntfy/client.yml" ]]; then cp "$tmpdir/${NTFY_DIR}/client/client.yml" ~/.config/ntfy/client.yml fi + return 0 } main() { install_ntfy msgr "done" "ntfy installation complete" + return 0 } main "$@" diff --git a/scripts/install-python-packages.sh b/scripts/install-python-packages.sh index 2ba0fa9..2176dc6 100755 --- a/scripts/install-python-packages.sh +++ b/scripts/install-python-packages.sh @@ -40,6 +40,7 @@ install_tools() uv tool install --upgrade "$pkg" echo "" done + return 0 } # Function to install library packages via uv pip install @@ -56,6 +57,7 @@ install_libraries() uv pip install --system --upgrade "$pkg" echo "" done + return 0 } # Function to upgrade all uv-managed tools @@ -63,6 +65,7 @@ upgrade_tools() { msgr run "Upgrading all uv-managed tools" uv tool upgrade --all + return 0 } main() @@ -71,6 +74,7 @@ main() install_libraries upgrade_tools msgr yay "Python package installations complete" + return 0 } main "$@" diff --git a/scripts/install-xcode-cli-tools.sh b/scripts/install-xcode-cli-tools.sh index 55d816d..77c4275 100755 --- a/scripts/install-xcode-cli-tools.sh +++ b/scripts/install-xcode-cli-tools.sh @@ -27,6 +27,7 @@ keep_alive_sudo() sleep 60 kill -0 "$$" || exit done 2> /dev/null & + return 0 } XCODE_TOOLS_PATH="$(xcode-select -p)" @@ -46,6 +47,7 @@ prompt_xcode_install() msgr warn "You have cancelled the installation, please rerun the installer." exit 1 fi + return 0 } # Main function @@ -63,6 +65,7 @@ main() echo -n "." sleep 1 done + return 0 } main "$@" diff --git a/scripts/install-z.sh b/scripts/install-z.sh index 3e63920..b40e7e9 100755 --- a/scripts/install-z.sh +++ b/scripts/install-z.sh @@ -20,12 +20,14 @@ clone_z_repo() else msgr ok "z ($bin_path/) already installed" fi + return 0 } # Main function main() { clone_z_repo "$Z_GIT_PATH" "$Z_BIN_PATH" + return 0 } main "$@"