Last active
December 14, 2015 03:29
-
-
Save rev087/5021792 to your computer and use it in GitHub Desktop.
Start the FontPrep server and open it in Google Chrome's app mode
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
fontprep () | |
{ | |
# Move to the server folder | |
cd /Applications/FontPrep.app/Contents/Resources/fontprep_server | |
# Start the FontPrep server, fork the process and store it's pid | |
ruby src/main.rb & pid_server=$! | |
# Give some time for the server to start, then open the URL in Google Chrome's app mode | |
sleep 2 | |
exec /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --app="http://localhost:7500/?sasha" --user-data-dir="~/Library/Application Support/Google/Chrome/" "$@" & pid_browser=$! | |
# Wait for the Chrome process to close, then kill the server process | |
wait $pid_browser | |
kill $pid_server | |
# Finally, move back to the original folder | |
cd - | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment