Skip to content

Commit

Permalink
refactor: do not print msg if shfmt already installed
Browse files Browse the repository at this point in the history
  • Loading branch information
sripwoud committed May 26, 2024
1 parent 0daa100 commit 61fec64
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions scripts/bin/postinstall.bash
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ download() {
chmod +x "$script_dest"
}

is_already_installed() {
if command -v shfmt >/dev/null 2>&1; then
printf "%s %s %s\n" "Skipped" "${BROWN}shfmt$RESET" "download (already installed on system)"
exit
fi
exit_if_shfmt_already_installed() {
command -v shfmt >/dev/null 2>&1 && exit
}

check_install() {
Expand All @@ -33,7 +30,7 @@ check_install() {
}

main() {
is_already_installed
exit_if_shfmt_already_installed

printf "%s %s\n" "Installing" "${BROWN}shfmt$RESET"

Expand Down

0 comments on commit 61fec64

Please sign in to comment.