From 4edf137e5d6b65f9ac847db6694ac387c7e91f3e Mon Sep 17 00:00:00 2001 From: jk Date: Sun, 21 Nov 2021 13:14:41 +0100 Subject: [PATCH] chore(style): add shebang, set bash strict mode, create function --- arc/install.sh | 5 +++-- bat/install.sh | 4 ++-- chromedriver/install.sh | 4 ++-- comrak/install.sh | 4 ++-- curlie/install.sh | 4 ++-- dotenv-linter/install.sh | 8 ++++---- fd/install.sh | 4 ++-- ffmpeg/install.sh | 4 ++-- fzf/install.sh | 4 ++-- goreleaser/install.sh | 4 ++-- hexyl/install.sh | 4 ++-- jq/install.sh | 4 ++-- k9s/install.sh | 4 ++-- kubectx/install.sh | 4 ++-- kubens/install.sh | 4 ++-- lsd/install.sh | 4 ++-- myip/install.sh | 4 ++-- pandoc/install.sh | 4 ++-- powershell/install.sh | 4 ++-- sd/install.sh | 4 ++-- shfmt/install.sh | 4 ++-- ssh-utils/install.sh | 4 ++-- sudo/install.sh | 1 - vps-addswap/install.sh | 4 ++-- vps-utils/install.sh | 4 ++-- watchexec/install.sh | 4 ++-- xz/install.sh | 4 ++-- yq/install.sh | 4 ++-- 28 files changed, 57 insertions(+), 57 deletions(-) diff --git a/arc/install.sh b/arc/install.sh index 184c05c..81105b4 100644 --- a/arc/install.sh +++ b/arc/install.sh @@ -1,7 +1,8 @@ #!/bin/bash +set -e +set -u + function __init_arc() { - set -e - set -u #################### # Install archiver # diff --git a/bat/install.sh b/bat/install.sh index 004dea2..142efda 100644 --- a/bat/install.sh +++ b/bat/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_bat() { - set -e - set -u ############### # Install bat # diff --git a/chromedriver/install.sh b/chromedriver/install.sh index 29c8ec9..92cca88 100644 --- a/chromedriver/install.sh +++ b/chromedriver/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_chromedriver() { - set -e - set -u ######################## # Install chromedriver # diff --git a/comrak/install.sh b/comrak/install.sh index 4e2bfb6..163dfca 100644 --- a/comrak/install.sh +++ b/comrak/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_comrak() { - set -e - set -u ################## # Install comrak # diff --git a/curlie/install.sh b/curlie/install.sh index b5ccebf..ec5bcd9 100644 --- a/curlie/install.sh +++ b/curlie/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_curlie() { - set -e - set -u ################## # Install curlie # diff --git a/dotenv-linter/install.sh b/dotenv-linter/install.sh index 2cbf3a1..f78822b 100644 --- a/dotenv-linter/install.sh +++ b/dotenv-linter/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u -function __dotenv_linter() { - set -e - set -u +function __init_dotenv_linter() { ######################### # Install dotenv-linter # @@ -38,4 +38,4 @@ function __dotenv_linter() { } -__dotenv_linter +__init_dotenv_linter diff --git a/fd/install.sh b/fd/install.sh index 58c7568..85ef0b2 100644 --- a/fd/install.sh +++ b/fd/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_fd() { - set -e - set -u ############### # Install fd # diff --git a/ffmpeg/install.sh b/ffmpeg/install.sh index 9eddc54..fc1ef14 100644 --- a/ffmpeg/install.sh +++ b/ffmpeg/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_ffmpeg() { - set -e - set -u ################## # Install ffmpeg # diff --git a/fzf/install.sh b/fzf/install.sh index 7729455..eb86577 100644 --- a/fzf/install.sh +++ b/fzf/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_fzf() { - set -e - set -u ############### # Install fzf # diff --git a/goreleaser/install.sh b/goreleaser/install.sh index 477035c..a855cd4 100644 --- a/goreleaser/install.sh +++ b/goreleaser/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_goreleaser() { - set -e - set -u ###################### # Install goreleaser # diff --git a/hexyl/install.sh b/hexyl/install.sh index 74e2436..c3037b8 100644 --- a/hexyl/install.sh +++ b/hexyl/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_hexyl() { - set -e - set -u ############### # Install hexyl # diff --git a/jq/install.sh b/jq/install.sh index 205ea1b..0af4844 100644 --- a/jq/install.sh +++ b/jq/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_jq() { - set -e - set -u ############## # Install jq # diff --git a/k9s/install.sh b/k9s/install.sh index 158316c..7834504 100644 --- a/k9s/install.sh +++ b/k9s/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_k9s() { - set -e - set -u ################## # Install k9s # diff --git a/kubectx/install.sh b/kubectx/install.sh index 035a781..8a1ea38 100644 --- a/kubectx/install.sh +++ b/kubectx/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_kubectx() { - set -e - set -u ################### # Install kubectx # diff --git a/kubens/install.sh b/kubens/install.sh index aff1465..42f2bb2 100644 --- a/kubens/install.sh +++ b/kubens/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_kubens() { - set -e - set -u ################### # Install kubens # diff --git a/lsd/install.sh b/lsd/install.sh index ee91a4e..a840fed 100644 --- a/lsd/install.sh +++ b/lsd/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_lsd() { - set -e - set -u ############### # Install lsd # diff --git a/myip/install.sh b/myip/install.sh index 2f908b5..a544cd7 100644 --- a/myip/install.sh +++ b/myip/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_myip() { - set -e - set -u rm -f "$HOME/.local/bin/myip" webi_download "$WEBI_HOST/packages/myip/myip.sh" "$HOME/.local/bin/myip" diff --git a/pandoc/install.sh b/pandoc/install.sh index 2ab940b..f3b59c0 100644 --- a/pandoc/install.sh +++ b/pandoc/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_pandoc() { - set -e - set -u ################### # Install pandoc # diff --git a/powershell/install.sh b/powershell/install.sh index 01f5d02..f243a44 100644 --- a/powershell/install.sh +++ b/powershell/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_powershell() { - set -e - set -u pkg_cmd_name="pwsh" # no ./bin prefix diff --git a/sd/install.sh b/sd/install.sh index 0d73cdd..0668e1f 100644 --- a/sd/install.sh +++ b/sd/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_sd() { - set -e - set -u ################## # Install sd # diff --git a/shfmt/install.sh b/shfmt/install.sh index c2d2123..b57cb99 100644 --- a/shfmt/install.sh +++ b/shfmt/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_shfmt() { - set -e - set -u ################## # Install shfmt # diff --git a/ssh-utils/install.sh b/ssh-utils/install.sh index 4b47f9a..3209547 100644 --- a/ssh-utils/install.sh +++ b/ssh-utils/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -function __init_ssh_utils() { +function __install_ssh_utils() { rm -f \ "$HOME/.local/bin/ssh-pubkey" \ "$HOME/.local/bin/ssh-setpass" \ @@ -20,4 +20,4 @@ function __init_ssh_utils() { chmod a+x "$HOME/.local/bin/ssh-"* } -__init_ssh_utils +__install_ssh_utils diff --git a/sudo/install.sh b/sudo/install.sh index 679c86b..112d8e7 100644 --- a/sudo/install.sh +++ b/sudo/install.sh @@ -1,5 +1,4 @@ #!/bin/bash - set -e set -u diff --git a/vps-addswap/install.sh b/vps-addswap/install.sh index 12ddbcd..64c8496 100644 --- a/vps-addswap/install.sh +++ b/vps-addswap/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_vps_addswap() { - set -e - set -u default_size=2G my_size=${1:-$default_size} diff --git a/vps-utils/install.sh b/vps-utils/install.sh index 1e260a9..3eb136b 100644 --- a/vps-utils/install.sh +++ b/vps-utils/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_vps_utils() { - set -e - set -u rm -f "$HOME/.local/bin/myip" "$HOME/.local/bin/vps-myip" "$HOME/.local/bin/vps-addswap" "$HOME/.local/bin/cap-net-bind" webi_download "$WEBI_HOST/packages/vps-utils/cap-net-bind.sh" "$HOME/.local/bin/cap-net-bind" diff --git a/watchexec/install.sh b/watchexec/install.sh index d6fba6e..f457f0f 100644 --- a/watchexec/install.sh +++ b/watchexec/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_watchexec() { - set -e - set -u ##################### # Install watchexec # diff --git a/xz/install.sh b/xz/install.sh index 390ea1d..d571160 100644 --- a/xz/install.sh +++ b/xz/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_xz() { - set -e - set -u ############## # Install xz # diff --git a/yq/install.sh b/yq/install.sh index 8e445a5..adb4f55 100644 --- a/yq/install.sh +++ b/yq/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u function __init_yq() { - set -e - set -u pkg_cmd_name="yq" -- 2.25.1