Created
November 11, 2021 05:20
-
-
Save ayrilmaz/00ef8b448c690d0462f608aac551accf to your computer and use it in GitHub Desktop.
Run docker compose apple script
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
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