diff --git a/setup.sh b/setup.sh index c28c047..f1c1004 100755 --- a/setup.sh +++ b/setup.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash -declare -a dependencies=(jq gh bat glow awk) +declare -a dependencies=("awk" "jq" "gh" "bat" "glow" "shfmt") declare -a notInstalled=() for i in "${dependencies[@]}"; do - which ${i} 1>/dev/null || notInstalled+=(${i}) + which ${i} 1>/dev/null || notInstalled+=("${i}") done if [[ ${#notInstalled[@]} -eq 0 ]]; then @@ -13,6 +13,7 @@ if [[ ${#notInstalled[@]} -eq 0 ]]; then else text="${notInstalled[@]}" echo "installing: ${text// /, }" + brew install ${notInstalled[@]} && echo "all dependencies installed!" && exit 0 || echo "warning: could not install all dependencies" && exit 1 diff --git a/ui.sh b/ui.sh index c8e418e..fc57be1 100644 --- a/ui.sh +++ b/ui.sh @@ -48,8 +48,10 @@ _viewSinglePage() { trap "tput rmcup; exit 1" SIGINT tput smcup for ((i = 0; i < max; i += 1)); do - echo "${items[i]}" # skipping last item on first render, needs `echo -n` + echo "${items[i]}" done + _mvBottom # temp fix for not printing last item in list + _printItem _mvTop _printItemBold