diff --git a/compile_urrl.sh b/compile_urrl.sh index 85341de..1dafb8d 100755 --- a/compile_urrl.sh +++ b/compile_urrl.sh @@ -1,16 +1,26 @@ #!/bin/bash +build () { + dir="$1" + i="$2" + cd "./$dir" || exit + f=$(echo "$dir" | sed 's/\.\///') + nimble install -y + if [[ $i == "install" ]]; then + sudo cp -v "$f" "/usr/local/bin/$f" + fi + cd ../ +} + +if [[ $2 != "" ]]; then + build "$2" "$1" + exit +fi for dir in ./*; do if [ -d "$dir" ]; then if [[ "$dir" == "./" ]]; then continue fi - cd "$dir" || exit - f=$(echo "$dir" | sed 's/\.\///') - nimble install -y - if [[ $1 == "install" ]]; then - sudo cp -v "$f" "/usr/local/bin/$f" - fi - cd ../ + build "$dir" "$1" fi done diff --git a/globurrl.nim b/globurrl.nim index dc6986e..c0ba020 100644 --- a/globurrl.nim +++ b/globurrl.nim @@ -198,7 +198,7 @@ proc genMenuCmd*(data: Info, opts: varargs[string], rofi: bool = false): string cmd = cmd & text & "\n" cmd.removeSuffix("\n") - var x_lines = len(opts) + var x_lines = len(opts) + 1 if x_lines > MAX_LINES: x_lines = MAX_LINES @@ -208,7 +208,7 @@ proc genMenuCmd*(data: Info, opts: varargs[string], rofi: bool = false): string cmd = cmd & menu.command & " " cmd = cmd & menu.extra_cmd & " " cmd = cmd & menu.i_case & " " - cmd = cmd & menu.lines_shown & " " & $MAX_LINES & " " + cmd = cmd & menu.lines_shown & " " & $x_lines & " " cmd = cmd & menu.prompt & quote(data.title) cmd = cmd & menu.norm_bg & quote(data.unselected_bg) cmd = cmd & menu.norm_fg & quote(data.unselected_fg)