Skip to content

Commit

Permalink
fix last item list render
Browse files Browse the repository at this point in the history
  • Loading branch information
ixc7 committed Jan 3, 2024
1 parent 14bd7d9 commit 6b15af3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6b15af3

Please sign in to comment.