chore: update shfmt

This commit is contained in:
AJ ONeal
2023-02-11 21:39:07 +00:00
parent 5fc3d0e174
commit b5fc4d742b
21 changed files with 52 additions and 52 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -27,4 +27,4 @@ main() {
"${my_sudo}" setcap 'cap_net_bind_service=+ep' "${my_bin}"
}
main "${1:-}"
main "${1-}"

View File

@@ -7,4 +7,4 @@ main() {
ssh-keygen -p -f "${my_key}"
}
main "${1:-}"
main "${1-}"

View File

@@ -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