Created
April 24, 2022 14:44
-
-
Save callingmedic911/44f41b3a944e28877f1498ec29bdd0a5 to your computer and use it in GitHub Desktop.
Raycast command wrapper for Supabase CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Required parameters: | |
# @raycast.schemaVersion 1 | |
# @raycast.title Supabase | |
# @raycast.mode fullOutput | |
# Optional parameters: | |
# @raycast.icon images/supabase.png | |
# @raycast.argument1 { "type": "text", "placeholder": "cmd" } | |
# Documentation: | |
# @raycast.description Wrapper for Supabase CLI | |
# @raycast.author Aditya Pandey | |
# @raycast.authorURL twitter.com/callingmedic911 | |
start_docker () { | |
# Open Docker, only if is not running | |
if (! docker stats --no-stream &> /dev/null); then | |
# On Mac OS this would be the terminal command to launch Docker | |
open /Applications/Docker.app | |
# Wait until Docker daemon is running and has completed initialisation | |
while (! docker stats --no-stream &> /dev/null); do | |
# Docker takes a few seconds to initialize | |
echo "Waiting for Docker to launch..." | |
sleep 1 | |
done | |
fi | |
} | |
cd "/path/to/project" || exit | |
if [[ "$1" == "start" ]]; then | |
start_docker | |
supabase "$1" | |
fi | |
if [[ "$1" == "stop" ]]; then | |
supabase "$1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment