Add gifs for Gum post

This commit is contained in:
Devon Campbell 2024-06-24 00:22:59 -04:00
commit fa056712d1
4 changed files with 35 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View file

@ -0,0 +1,17 @@
function donpm() {
if [ ! -f "package.json" ]; then
gum log --level error "package.json not found in the current directory"
return 1
fi
OPTIONS=$(jq -r '.scripts|to_entries[]|((.key))' package.json)
OPTIONS+="\n🛑 Cancel"
SELECTION=$(echo $OPTIONS | gum choose --header "Choose a script to run")
if [[ "$SELECTION" == "🛑 Cancel" ]]; then
gum log --level info "Execution was cancelled"
return 1
else
npm run $SELECTION
fi
}

View file

@ -0,0 +1,16 @@
# Run `vhs` from project root to get the correct output
Output images/blog/outsourcing-my-memory-to-gum/donpm.gif
Set Shell "zsh"
Set FontSize 32
Set Width 1100
Set Height 600
Hide
Type "source images/blog/outsourcing-my-memory-to-gum/donpm.sh && clear" Enter
Show
Type "donpm" Sleep 500ms Enter
Sleep 1.5s
Down Sleep 150ms Down Sleep 300ms Enter
Sleep 3s

View file

@ -1,7 +1,7 @@
# Run `vhs` from project root to get the correct output # Run `vhs` from project root to get the correct output
Output assets/images/blog/outsourcing-my-memory-to-gum/script-discovery.gif Output images/blog/outsourcing-my-memory-to-gum/script-discovery.gif
Set Shell "bash" Set Shell "zsh"
Set FontSize 32 Set FontSize 32
Set Width 1100 Set Width 1100
Set Height 900 Set Height 900