Skip to content

Instantly share code, notes, and snippets.

@callingmedic911
Created April 24, 2022 14:44
Show Gist options
  • Save callingmedic911/44f41b3a944e28877f1498ec29bdd0a5 to your computer and use it in GitHub Desktop.
Save callingmedic911/44f41b3a944e28877f1498ec29bdd0a5 to your computer and use it in GitHub Desktop.
Raycast command wrapper for Supabase CLI
#!/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