Add gifs for Gum post
This commit is contained in:
parent
9d493413c8
commit
fa056712d1
4 changed files with 35 additions and 2 deletions
BIN
images/blog/outsourcing-my-memory-to-gum/donpm.gif
Normal file
BIN
images/blog/outsourcing-my-memory-to-gum/donpm.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
17
images/blog/outsourcing-my-memory-to-gum/donpm.sh
Normal file
17
images/blog/outsourcing-my-memory-to-gum/donpm.sh
Normal 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
|
||||
}
|
||||
16
images/blog/outsourcing-my-memory-to-gum/donpm.tape
Normal file
16
images/blog/outsourcing-my-memory-to-gum/donpm.tape
Normal 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
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# 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 Width 1100
|
||||
Set Height 900
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue