Skip to content

Instantly share code, notes, and snippets.

@ayrilmaz
Created November 11, 2021 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayrilmaz/00ef8b448c690d0462f608aac551accf to your computer and use it in GitHub Desktop.
Save ayrilmaz/00ef8b448c690d0462f608aac551accf to your computer and use it in GitHub Desktop.
Run docker compose apple script
set actions to {"up", "down"}
set action to choose from list actions with prompt "Select your action:"
if action = false then
else
if action = {"up"} then
tell application "Terminal"
activate
do script ("cd /Users/emreayrilmaz/Projects/github/docker-builds/pgadmin4/ && docker-compose up -d")
delay 3
end tell
tell application "Safari"
activate
tell window 1
set current tab to (make new tab with properties {URL:"http://localhost:1800"})
delay 3
end tell
end tell
else
tell application "Terminal"
activate
set currentTab to do script ("cd /Users/emreayrilmaz/Projects/github/docker-builds/pgadmin4/ && docker-compose down")
delay 3
end tell
end if
end if
on closeIt()
tell application "System Events"
tell process "Terminal"
keystroke "w" using {command down}
end tell
end tell
end closeIt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment