Make commands more resilient

This commit is contained in:
David Heinemeier Hansson 2024-06-03 15:32:02 -07:00
parent 07894acedd
commit 87dc5549dc
4 changed files with 14 additions and 5 deletions

View File

@ -1,5 +1,12 @@
#!/bin/bash
source $OMAKUB_PATH/ascii.sh
SUB=$(gum choose "Help" "Theme" "Font" "Install" | tr '[:upper:]' '[:lower:]')
source $OMAKUB_PATH/bin/omakub-$SUB
if [ $# -eq 0 ]; then
SUB=$(gum choose "Help" "Theme" "Font" "Install" --height 7 --header "" | tr '[:upper:]' '[:lower:]')
else
SUB=$1
fi
[ -n "$SUB" ] && source $OMAKUB_PATH/bin/omakub-$SUB

View File

@ -4,6 +4,8 @@ set -e
# Pick a preconfigured theme
FONT=$(gum choose "Cascadia Mono" "Fira Mono" "JetBrains Mono" "Meslo" | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')
[ ! -n "$FONT" ] && exit 0
if [ "$FONT" == "cascadia-mono" ]; then
NERD_FONT="CaskaydiaMono Nerd Font"
elif [ "$FONT" == "fira-mono" ]; then

View File

@ -1,4 +1,4 @@
#!/bin/bash
HELP=$(gum choose "Hotkeys" "Commands" "Tactile" | tr '[:upper:]' '[:lower:]')
gum pager <$OMAKUB_PATH/help/$HELP.md
HELP=$(gum choose "Hotkeys" "Commands" "Tactile" --height 5 | tr '[:upper:]' '[:lower:]')
[ -n "$HELP" ] && gum pager <$OMAKUB_PATH/help/$HELP.md

View File

@ -1,4 +1,4 @@
#!/bin/bash
INSTALLER=$(gum file $OMAKUB_PATH/install)
gum confirm "Run installer?" && source $INSTALLER
[ -n "$INSTALLER" ] && gum confirm "Run installer?" && source $INSTALLER