From b5fc4d742b539f416ce92560fd0e33d470df9457 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 11 Feb 2023 21:39:07 +0000 Subject: [PATCH] chore: update shfmt --- _webi/bootstrap.sh | 6 +++--- _webi/template.sh | 34 ++++++++++++++++---------------- archiver/install.sh | 4 ++-- gnupg/install.sh | 4 ++-- go-essentials/install.sh | 2 +- go/install.sh | 4 ++-- golang/install.sh | 4 ++-- iterm-color-schemes/install.sh | 4 ++-- iterm-themes/install.sh | 4 ++-- iterm-utils/install.sh | 4 ++-- iterm/install.sh | 4 ++-- iterm2-color-schemes/install.sh | 4 ++-- nerd-font/install.sh | 2 +- postgresql/install.sh | 2 +- pwsh/install.sh | 4 ++-- python3/install.sh | 4 ++-- ripgrep/install.sh | 4 ++-- rust/install.sh | 2 +- setcap-netbind/setcap-netbind.sh | 2 +- ssh-setpass/ssh-setpass.sh | 2 +- ziglang/install.sh | 4 ++-- 21 files changed, 52 insertions(+), 52 deletions(-) diff --git a/_webi/bootstrap.sh b/_webi/bootstrap.sh index aa3f743..5ab3479 100644 --- a/_webi/bootstrap.sh +++ b/_webi/bootstrap.sh @@ -15,7 +15,7 @@ __install_webi() { export WEBI_HOST echo "" - printf "Thanks for using webi to install '\e[32m%s\e[0m' on '\e[31m%s/%s\e[0m'.\n" "${WEBI_PKG:-}" "$(uname -s)" "$(uname -m)" + printf "Thanks for using webi to install '\e[32m%s\e[0m' on '\e[31m%s/%s\e[0m'.\n" "${WEBI_PKG-}" "$(uname -s)" "$(uname -m)" echo "Have a problem? Experience a bug? Please let us know:" echo " https://github.com/webinstall/webi-installers/issues" echo "" @@ -214,13 +214,13 @@ EOF chmod a+x "$HOME/.local/bin/webi" - if [ -n "${WEBI_PKG:-}" ]; then + if [ -n "${WEBI_PKG-}" ]; then "$HOME/.local/bin/webi" "${WEBI_PKG}" else echo "" echo "Hmm... no WEBI_PKG was specified. This is probably an error in the script." echo "" - echo "Please open an issue with this information: Package '${WEBI_PKG:-}' on '$(uname -s)/$(uname -m)'" + echo "Please open an issue with this information: Package '${WEBI_PKG-}' on '$(uname -s)/$(uname -m)'" echo " https://github.com/webinstall/packages/issues" echo "" fi diff --git a/_webi/template.sh b/_webi/template.sh index 615b328..d1d82b6 100644 --- a/_webi/template.sh +++ b/_webi/template.sh @@ -48,7 +48,7 @@ __bootstrap_webi() { ## Set up tmp, download, and install directories ## - WEBI_TMP=${WEBI_TMP:-"$(mktemp -d -t webinstall-"${WEBI_PKG:-}".XXXXXXXX)"} + WEBI_TMP=${WEBI_TMP:-"$(mktemp -d -t webinstall-"${WEBI_PKG-}".XXXXXXXX)"} export _webi_tmp="${_webi_tmp:-"$HOME/.local/opt/webi-tmp.d"}" mkdir -p "${WEBI_PKG_PATH}" @@ -91,7 +91,7 @@ __bootstrap_webi() { return 0 fi - if [ -n "$WEBI_SINGLE" ] || [ "single" = "${1:-}" ]; then + if [ -n "$WEBI_SINGLE" ] || [ "single" = "${1-}" ]; then rm -rf "$pkg_dst_cmd" ln -s "$pkg_src_cmd" "$pkg_dst_cmd" else @@ -159,12 +159,12 @@ __bootstrap_webi() { # detect if file is downloaded, and how to download it webi_download() { # determine the url to download - if [ -n "${1:-}" ]; then + if [ -n "${1-}" ]; then my_url="$1" else if [ "error" = "$WEBI_CHANNEL" ]; then # TODO pass back requested OS / Arch / Version - echo >&2 "Error: no '$PKG_NAME' release for '${WEBI_OS:-}' on '$WEBI_ARCH' as one of '$WEBI_FORMATS' by the tag '${WEBI_TAG:-}'" + echo >&2 "Error: no '$PKG_NAME' release for '${WEBI_OS-}' on '$WEBI_ARCH' as one of '$WEBI_FORMATS' by the tag '${WEBI_TAG-}'" echo >&2 " '$PKG_NAME' is available for '$PKG_OSES' on '$PKG_ARCHES' as one of '$PKG_FORMATS'" echo >&2 " (check that the package name and version are correct)" echo >&2 "" @@ -176,7 +176,7 @@ __bootstrap_webi() { fi # determine the location to download to - if [ -n "${2:-}" ]; then + if [ -n "${2-}" ]; then my_dl="$2" else my_dl="${WEBI_PKG_PATH}/$WEBI_PKG_FILE" @@ -283,7 +283,7 @@ __bootstrap_webi() { # shellcheck disable=2120 # webi_install may be sourced and used elsewhere webi_install() { - if [ -n "$WEBI_SINGLE" ] || [ "single" = "${1:-}" ]; then + if [ -n "$WEBI_SINGLE" ] || [ "single" = "${1-}" ]; then mkdir -p "$(dirname "$pkg_src_cmd")" mv ./"$pkg_cmd_name"* "$pkg_src_cmd" else @@ -337,9 +337,9 @@ __bootstrap_webi() { WEBI_SINGLE= - if [ -z "${WEBI_WELCOME:-}" ]; then + if [ -z "${WEBI_WELCOME-}" ]; then echo "" - printf "Thanks for using webi to install '\e[32m%s\e[0m' on '\e[31m%s/%s\e[0m'.\n" "${WEBI_PKG:-}" "$(uname -s)" "$(uname -m)" + printf "Thanks for using webi to install '\e[32m%s\e[0m' on '\e[31m%s/%s\e[0m'.\n" "${WEBI_PKG-}" "$(uname -s)" "$(uname -m)" echo "Have a problem? Experience a bug? Please let us know:" echo " https://github.com/webinstall/webi-installers/issues" echo "" @@ -371,14 +371,14 @@ __bootstrap_webi() { command -v pkg_post_install > /dev/null || command -v pkg_done_message > /dev/null || command -v pkg_format_cmd_version > /dev/null || - [ -n "${WEBI_SINGLE:-}" ] || - [ -n "${pkg_cmd_name:-}" ] || - [ -n "${pkg_dst_cmd:-}" ] || - [ -n "${pkg_dst_dir:-}" ] || - [ -n "${pkg_dst:-}" ] || - [ -n "${pkg_src_cmd:-}" ] || - [ -n "${pkg_src_dir:-}" ] || - [ -n "${pkg_src:-}" ]; then + [ -n "${WEBI_SINGLE-}" ] || + [ -n "${pkg_cmd_name-}" ] || + [ -n "${pkg_dst_cmd-}" ] || + [ -n "${pkg_dst_dir-}" ] || + [ -n "${pkg_dst-}" ] || + [ -n "${pkg_src_cmd-}" ] || + [ -n "${pkg_src_dir-}" ] || + [ -n "${pkg_src-}" ]; then pkg_cmd_name="${pkg_cmd_name:-$PKG_NAME}" @@ -429,7 +429,7 @@ __bootstrap_webi() { fi webi_path_add "$HOME/.local/bin" - if [ -z "${_WEBI_CHILD:-}" ] && [ -f "$_webi_tmp/.PATH.env" ]; then + if [ -z "${_WEBI_CHILD-}" ] && [ -f "$_webi_tmp/.PATH.env" ]; then if [ -n "$(cat "$_webi_tmp/.PATH.env")" ]; then printf 'PATH.env updated with:\n' sort -u "$_webi_tmp/.PATH.env" diff --git a/archiver/install.sh b/archiver/install.sh index 601c9a0..02b76b8 100644 --- a/archiver/install.sh +++ b/archiver/install.sh @@ -3,9 +3,9 @@ set -e set -u __redirect_alias_arc() { - echo "'archiver@${WEBI_TAG:-stable}' is an alias for 'arc@${WEBI_VERSION:-}'" + echo "'archiver@${WEBI_TAG:-stable}' is an alias for 'arc@${WEBI_VERSION-}'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/arc@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/arc@${WEBI_VERSION-}" | sh } __redirect_alias_arc diff --git a/gnupg/install.sh b/gnupg/install.sh index b69f30c..37fe6f2 100644 --- a/gnupg/install.sh +++ b/gnupg/install.sh @@ -3,9 +3,9 @@ set -e set -u __redirect_alias_gpg() { - echo "'gnupg@${WEBI_TAG:-stable}' is an alias for 'gpg@${WEBI_VERSION:-}'" + echo "'gnupg@${WEBI_TAG:-stable}' is an alias for 'gpg@${WEBI_VERSION-}'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/gpg@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/gpg@${WEBI_VERSION-}" | sh } __redirect_alias_gpg diff --git a/go-essentials/install.sh b/go-essentials/install.sh index f37cbed..76b3092 100644 --- a/go-essentials/install.sh +++ b/go-essentials/install.sh @@ -5,7 +5,7 @@ set -u __run_go_essentials() { WEBI__GO_ESSENTIALS='true' export WEBI__GO_ESSENTIALS - if [ -z "${WEBI__GO_INSTALL:-}" ]; then + if [ -z "${WEBI__GO_INSTALL-}" ]; then "$HOME/.local/bin/webi" "golang@${WEBI_TAG}" fi diff --git a/go/install.sh b/go/install.sh index 6ad5caa..328b598 100644 --- a/go/install.sh +++ b/go/install.sh @@ -3,9 +3,9 @@ set -e set -u __redirect_alias_golang() { - echo "'go@${WEBI_TAG:-stable}' is an alias for 'golang@${WEBI_VERSION:-}'" + echo "'go@${WEBI_TAG:-stable}' is an alias for 'golang@${WEBI_VERSION-}'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/golang@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/golang@${WEBI_VERSION-}" | sh } __redirect_alias_golang diff --git a/golang/install.sh b/golang/install.sh index 8101615..b797b2f 100644 --- a/golang/install.sh +++ b/golang/install.sh @@ -15,7 +15,7 @@ pkg_cmd_name="go" # # Their defaults are defined in _webi/template.sh at https://github.com/webinstall/packages -if [ -z "${WEBI__GO_ESSENTIALS:-}" ]; then +if [ -z "${WEBI__GO_ESSENTIALS-}" ]; then # TODO nix for go1.21+ echo >&2 "" printf >&2 '\e[31m%s:\e[0m\n' '#####################' @@ -69,7 +69,7 @@ pkg_post_install() { webi_path_add "$pkg_dst_bin" webi_path_add "$GOBIN/bin" - if [ -z "${WEBI__GO_ESSENTIALS:-}" ]; then + if [ -z "${WEBI__GO_ESSENTIALS-}" ]; then # TODO nix for go1.21+ WEBI__GO_INSTALL='true' export WEBI__GO_INSTALL diff --git a/iterm-color-schemes/install.sh b/iterm-color-schemes/install.sh index a4f14ba..d0a6f69 100644 --- a/iterm-color-schemes/install.sh +++ b/iterm-color-schemes/install.sh @@ -3,9 +3,9 @@ set -e set -u __redirect_alias_iterm2_themes() { - echo "'iterm-color-schemes@${WEBI_TAG:-stable}' is an alias for 'iterm2-themes@${WEBI_VERSION:-}'" + echo "'iterm-color-schemes@${WEBI_TAG:-stable}' is an alias for 'iterm2-themes@${WEBI_VERSION-}'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/iterm2-themes@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/iterm2-themes@${WEBI_VERSION-}" | sh } __redirect_alias_iterm2_themes diff --git a/iterm-themes/install.sh b/iterm-themes/install.sh index bc5fda7..fd9322e 100644 --- a/iterm-themes/install.sh +++ b/iterm-themes/install.sh @@ -3,9 +3,9 @@ set -e set -u __redirect_alias_iterm2_themes() { - echo "'iterm-themes@${WEBI_TAG:-stable}' is an alias for 'iterm2-themes@${WEBI_VERSION:-}'" + echo "'iterm-themes@${WEBI_TAG:-stable}' is an alias for 'iterm2-themes@${WEBI_VERSION-}'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/iterm2-themes@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/iterm2-themes@${WEBI_VERSION-}" | sh } __redirect_alias_iterm2_themes diff --git a/iterm-utils/install.sh b/iterm-utils/install.sh index 2eaf34f..db609d0 100644 --- a/iterm-utils/install.sh +++ b/iterm-utils/install.sh @@ -3,9 +3,9 @@ set -e set -u __redirect_alias_iterm2_utils() { - echo "'iterm-utils@${WEBI_TAG:-stable}' is an alias for 'iterm2-utils@${WEBI_VERSION:-}'" + echo "'iterm-utils@${WEBI_TAG:-stable}' is an alias for 'iterm2-utils@${WEBI_VERSION-}'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/iterm2-utils@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/iterm2-utils@${WEBI_VERSION-}" | sh } __redirect_alias_iterm2_utils diff --git a/iterm/install.sh b/iterm/install.sh index 6eb1b04..26ceb41 100644 --- a/iterm/install.sh +++ b/iterm/install.sh @@ -2,6 +2,6 @@ set -e set -u -echo "'iterm@${WEBI_TAG:-stable}' is an alias for 'iterm2@${WEBI_VERSION:-}'" +echo "'iterm@${WEBI_TAG:-stable}' is an alias for 'iterm2@${WEBI_VERSION-}'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} -curl -fsSL "$WEBI_HOST/iterm2@${WEBI_VERSION:-}" | sh +curl -fsSL "$WEBI_HOST/iterm2@${WEBI_VERSION-}" | sh diff --git a/iterm2-color-schemes/install.sh b/iterm2-color-schemes/install.sh index 68cff11..c1841c5 100644 --- a/iterm2-color-schemes/install.sh +++ b/iterm2-color-schemes/install.sh @@ -3,9 +3,9 @@ set -e set -u __redirect_alias_iterm2_themes() { - echo "'iterm2-color-schemes@${WEBI_TAG:-stable}' is an alias for 'iterm2-themes@${WEBI_VERSION:-}'" + echo "'iterm2-color-schemes@${WEBI_TAG:-stable}' is an alias for 'iterm2-themes@${WEBI_VERSION-}'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/iterm2-themes@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/iterm2-themes@${WEBI_VERSION-}" | sh } __redirect_alias_iterm2_themes diff --git a/nerd-font/install.sh b/nerd-font/install.sh index d5ca6c1..943e15c 100644 --- a/nerd-font/install.sh +++ b/nerd-font/install.sh @@ -5,7 +5,7 @@ set -u __redirect_alias_nerdfont() { echo "'nerd-font' is an alias for 'nerdfont'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/nerdfont@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/nerdfont@${WEBI_VERSION-}" | sh } __redirect_alias_nerdfont diff --git a/postgresql/install.sh b/postgresql/install.sh index 40523c0..0855be1 100644 --- a/postgresql/install.sh +++ b/postgresql/install.sh @@ -5,7 +5,7 @@ set -u __redirect_alias_postgres() { echo "'postgresql' is an alias for 'postgres'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/postgres@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/postgres@${WEBI_VERSION-}" | sh } __redirect_alias_postgres diff --git a/pwsh/install.sh b/pwsh/install.sh index 4760b1c..8a64617 100644 --- a/pwsh/install.sh +++ b/pwsh/install.sh @@ -3,9 +3,9 @@ set -e set -u __redirect_alias_powershell() { - echo "'pwsh@${WEBI_TAG:-stable}' is an alias for 'powershell@${WEBI_VERSION:-}'" + echo "'pwsh@${WEBI_TAG:-stable}' is an alias for 'powershell@${WEBI_VERSION-}'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/powershell@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/powershell@${WEBI_VERSION-}" | sh } __redirect_alias_powershell diff --git a/python3/install.sh b/python3/install.sh index dac6fb4..100bbb6 100644 --- a/python3/install.sh +++ b/python3/install.sh @@ -4,9 +4,9 @@ set -e set -u __redirect_alias_python() { - echo "'python@${WEBI_TAG:-stable}' is an alias for 'python@${WEBI_VERSION:-}'" + echo "'python@${WEBI_TAG:-stable}' is an alias for 'python@${WEBI_VERSION-}'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/python@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/python@${WEBI_VERSION-}" | sh } __redirect_alias_python diff --git a/ripgrep/install.sh b/ripgrep/install.sh index c884d90..f4ab64d 100644 --- a/ripgrep/install.sh +++ b/ripgrep/install.sh @@ -3,9 +3,9 @@ set -e set -u __redirect_alias_rg() { - echo "'ripgrep@${WEBI_TAG:-}' (project) is an alias for 'rg@${WEBI_VERSION:-}' (command)" + echo "'ripgrep@${WEBI_TAG-}' (project) is an alias for 'rg@${WEBI_VERSION-}' (command)" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/rg@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/rg@${WEBI_VERSION-}" | sh } __redirect_alias_rg diff --git a/rust/install.sh b/rust/install.sh index dd3596d..37cedd4 100644 --- a/rust/install.sh +++ b/rust/install.sh @@ -5,7 +5,7 @@ set -u __redirect_alias_rustlang() { echo "'rust' is an alias for 'rustlang'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/rustlang@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/rustlang@${WEBI_VERSION-}" | sh } __redirect_alias_rustlang diff --git a/setcap-netbind/setcap-netbind.sh b/setcap-netbind/setcap-netbind.sh index 512721e..ed74e9f 100644 --- a/setcap-netbind/setcap-netbind.sh +++ b/setcap-netbind/setcap-netbind.sh @@ -27,4 +27,4 @@ main() { "${my_sudo}" setcap 'cap_net_bind_service=+ep' "${my_bin}" } -main "${1:-}" +main "${1-}" diff --git a/ssh-setpass/ssh-setpass.sh b/ssh-setpass/ssh-setpass.sh index db6c128..b7fe5ee 100644 --- a/ssh-setpass/ssh-setpass.sh +++ b/ssh-setpass/ssh-setpass.sh @@ -7,4 +7,4 @@ main() { ssh-keygen -p -f "${my_key}" } -main "${1:-}" +main "${1-}" diff --git a/ziglang/install.sh b/ziglang/install.sh index 22cc3db..18a2304 100644 --- a/ziglang/install.sh +++ b/ziglang/install.sh @@ -3,9 +3,9 @@ set -e set -u __redirect_alias_zig() { - echo "'ziglang@${WEBI_TAG:-stable}' is an alias for 'zig@${WEBI_VERSION:-}'" + echo "'ziglang@${WEBI_TAG:-stable}' is an alias for 'zig@${WEBI_VERSION-}'" WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} - curl -fsSL "$WEBI_HOST/zig@${WEBI_VERSION:-}" | sh + curl -fsSL "$WEBI_HOST/zig@${WEBI_VERSION-}" | sh } __redirect_alias_zig