Skip to content

Instantly share code, notes, and snippets.

@mrgnw
Created September 14, 2023 09:01
Show Gist options
  • Save mrgnw/4ff135e7fdc790e493d30d7e7c3344ec to your computer and use it in GitHub Desktop.
Save mrgnw/4ff135e7fdc790e493d30d7e7c3344ec to your computer and use it in GitHub Desktop.
Does the thing • "Zhu Li, do the thing!" • https://avatar.fandom.com/wiki/Zhu_Li_Moon
#!/usr/bin/env zsh
# Does the thing.
# "Zhu Li, do the thing!"
# https://avatar.fandom.com/wiki/Zhu_Li_Moon
# Make a .thing file to define what exactly that is.
if [[ -f .thing ]]; then ./.thing
elif [[ -f docker-compose.yml || -f docker-compose.yaml ]]; then docker-compose up
elif [[ -f main.py ]]; then uvicorn main:app --reload
elif [[ -f package.json ]]; then bun install && bun run dev
elif [[ -f Package.swift ]]; then swift run
elif [[ -f main.go ]]; then go run main.go
elif [[ -f Cargo.toml ]]; then cargo run
elif [[ -f index.html ]]; then python3 -m http.server 8000
else
echo "Creating a .thing to do the thing"
echo "#!/usr/bin/env zsh" > .thing
$EDITOR .thing
echo "to do the thing, make .thing executable"
echo "chmod +x .thing"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment