From 528c89c9fbbedc7724f692289e3aca5bd36dda06 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 5 Dec 2021 04:36:12 +0000 Subject: [PATCH] chore(style): wrap all bash redirect installers in functions --- archiver/install.sh | 10 +++++++--- git-gpg-init/install.sh | 11 ++++++++--- gnupg/install.sh | 10 +++++++--- go/install.sh | 10 +++++++--- iterm-color-schemes/install.sh | 11 ++++++++--- iterm-themes/install.sh | 11 ++++++++--- iterm-utils/install.sh | 10 +++++++--- iterm2-color-schemes/install.sh | 11 ++++++++--- nerd-font/install.sh | 10 +++++++--- postgresql/install.sh | 10 +++++++--- pwsh/install.sh | 10 +++++++--- ripgrep/install.sh | 10 +++++++--- rust/install.sh | 10 +++++++--- 13 files changed, 95 insertions(+), 39 deletions(-) diff --git a/archiver/install.sh b/archiver/install.sh index a817bf1..06fa957 100644 --- a/archiver/install.sh +++ b/archiver/install.sh @@ -6,6 +6,10 @@ # description: | # See https://webinstall.dev/arc -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:-}" | bash +function __redirect_alias_arc() { + 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:-}" | bash +} + +__redirect_alias_arc diff --git a/git-gpg-init/install.sh b/git-gpg-init/install.sh index be869b6..5ad8d30 100644 --- a/git-gpg-init/install.sh +++ b/git-gpg-init/install.sh @@ -1,3 +1,4 @@ +#!/bin/bash # title: git-gpg-init (git-config-gpg alias) # homepage: https://webinstall.dev/git-config-gpg # tagline: Alias for https://webinstall.dev/git-config-gpg @@ -5,6 +6,10 @@ # description: | # See https://webinstall.dev/git-config-gpg -echo "'git-gpg-init' is a deprecated alias for 'git-config-gpg'" -WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} -curl -fsSL "$WEBI_HOST/git-config-gpg" | bash +function __redirect_alias_git_config_gpg() { + echo "'git-gpg-init' is a deprecated alias for 'git-config-gpg'" + WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} + curl -fsSL "$WEBI_HOST/git-config-gpg" | bash +} + +__redirect_alias_git_config_gpg diff --git a/gnupg/install.sh b/gnupg/install.sh index 1d731da..f40b746 100644 --- a/gnupg/install.sh +++ b/gnupg/install.sh @@ -6,6 +6,10 @@ # description: | # See https://webinstall.dev/gpg -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:-}" | bash +function __redirect_alias_gpg() { + 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:-}" | bash +} + +__redirect_alias_gpg diff --git a/go/install.sh b/go/install.sh index c096eea..2b9aa1f 100644 --- a/go/install.sh +++ b/go/install.sh @@ -6,6 +6,10 @@ # description: | # See https://webinstall.dev/golang -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:-}" | bash +function __redirect_alias_golang() { + 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:-}" | bash +} + +__redirect_alias_golang diff --git a/iterm-color-schemes/install.sh b/iterm-color-schemes/install.sh index 3f4d484..afb5a8f 100644 --- a/iterm-color-schemes/install.sh +++ b/iterm-color-schemes/install.sh @@ -1,3 +1,4 @@ +#!/bin/bash # title: iterm-color-schemes (iterm2-themes alias) # homepage: https://webinstall.dev/iterm2-themes # tagline: Alias for https://webinstall.dev/iterm2-themes @@ -5,6 +6,10 @@ # description: | # See https://webinstall.dev/iterm2-themes -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:-}" | bash +function __redirect_alias_iterm2_themes() { + 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:-}" | bash +} + +__redirect_alias_iterm2_themes diff --git a/iterm-themes/install.sh b/iterm-themes/install.sh index 7a675e7..24b417d 100644 --- a/iterm-themes/install.sh +++ b/iterm-themes/install.sh @@ -1,3 +1,4 @@ +#!/bin/bash # title: iterm-themes (iterm2-themes alias) # homepage: https://webinstall.dev/iterm2-themes # tagline: Alias for https://webinstall.dev/iterm2-themes @@ -5,6 +6,10 @@ # description: | # See https://webinstall.dev/iterm2-themes -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:-}" | bash +function __redirect_alias_iterm2_themes() { + 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:-}" | bash +} + +__redirect_alias_iterm2_themes diff --git a/iterm-utils/install.sh b/iterm-utils/install.sh index b69437e..e18b42b 100644 --- a/iterm-utils/install.sh +++ b/iterm-utils/install.sh @@ -6,6 +6,10 @@ # description: | # See https://webinstall.dev/iterm2-utils -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:-}" | bash +function __redirect_alias_iterm2_utils() { + 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:-}" | bash +} + +__redirect_alias_iterm2_utils diff --git a/iterm2-color-schemes/install.sh b/iterm2-color-schemes/install.sh index fa9233d..7d767e4 100644 --- a/iterm2-color-schemes/install.sh +++ b/iterm2-color-schemes/install.sh @@ -1,3 +1,4 @@ +#!/bin/bash # title: iterm2-color-schemes (iterm2-themes alias) # homepage: https://webinstall.dev/iterm2-themes # tagline: Alias for https://webinstall.dev/iterm2-themes @@ -5,6 +6,10 @@ # description: | # See https://webinstall.dev/iterm2-themes -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:-}" | bash +function __redirect_alias_iterm2_themes() { + 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:-}" | bash +} + +__redirect_alias_iterm2_themes diff --git a/nerd-font/install.sh b/nerd-font/install.sh index b403cda..6f511d0 100644 --- a/nerd-font/install.sh +++ b/nerd-font/install.sh @@ -6,6 +6,10 @@ # description: | # See https://webinstall.dev/nerdfont -echo "'nerd-font' is an alias for 'nerdfont'" -WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} -curl -fsSL "$WEBI_HOST/nerdfont@${WEBI_VERSION:-}" | bash +function __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:-}" | bash +} + +__redirect_alias_nerdfont diff --git a/postgresql/install.sh b/postgresql/install.sh index 7f2aecc..4d6052e 100644 --- a/postgresql/install.sh +++ b/postgresql/install.sh @@ -6,6 +6,10 @@ # description: | # See https://webinstall.dev/postgres -echo "'postgresql' is an alias for 'postgres'" -WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} -curl -fsSL "$WEBI_HOST/postgres@${WEBI_VERSION:-}" | bash +function __redirect_alias_postgres() { + echo "'postgresql' is an alias for 'postgres'" + WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} + curl -fsSL "$WEBI_HOST/postgres@${WEBI_VERSION:-}" | bash +} + +__redirect_alias_postgres diff --git a/pwsh/install.sh b/pwsh/install.sh index d40fecb..3d0e2a4 100644 --- a/pwsh/install.sh +++ b/pwsh/install.sh @@ -6,6 +6,10 @@ # description: | # See https://webinstall.dev/powershell -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:-}" | bash +function __redirect_alias_powershell() { + 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:-}" | bash +} + +__redirect_alias_powershell diff --git a/ripgrep/install.sh b/ripgrep/install.sh index 9740211..e599a54 100644 --- a/ripgrep/install.sh +++ b/ripgrep/install.sh @@ -6,6 +6,10 @@ # description: | # See https://webinstall.dev/rg -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:-}" | bash +function __redirect_alias_rg() { + 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:-}" | bash +} + +__redirect_alias_rg diff --git a/rust/install.sh b/rust/install.sh index 33c06cb..94c00fd 100644 --- a/rust/install.sh +++ b/rust/install.sh @@ -6,6 +6,10 @@ # description: | # See https://webinstall.dev/rustlang -echo "'rust' is an alias for 'rustlang'" -WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} -curl -fsSL "$WEBI_HOST/rustlang@${WEBI_VERSION:-}" | bash +function __redirect_alias_rustlang() { + echo "'rust' is an alias for 'rustlang'" + WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} + curl -fsSL "$WEBI_HOST/rustlang@${WEBI_VERSION:-}" | bash +} + +__redirect_alias_rustlang