Last active
October 24, 2020 12:43
-
-
Save worthmine/0b3da902bd01647bbdd7292836756d5a to your computer and use it in GitHub Desktop.
run and open zenn preview automatically from terminal of your Mac
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/sh | |
SOURCE="npx zenn preview" | |
export DIR="~/Zenn" # 各自のディレクト名にリネームしてください。 | |
if [[ "$(uname)" = "Darwin" ]] && [[ -z "$ON_NEW_TERMINAL" ]] && [[ -z "$NO_NEW_TERMINAL" ]] ; then | |
osascript -e " | |
tell application \"Terminal\" | |
do script \"cd $DIR && $SOURCE\" in window 1 | |
end tell | |
tell application \"System Events\" | |
keystroke \"t\" using command down | |
end tell | |
tell application \"Terminal\" | |
do script \"cd $DIR && code ./articles \" in window 1 | |
end tell | |
-- Safariの人はSafariを指定してください | |
delay 6.0 | |
tell application \"Google Chrome\" | |
activate | |
open location \"http://localhost:8000\" | |
end tell" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment