Last active
December 11, 2015 17:28
-
-
Save luiscronicl/4634724 to your computer and use it in GitHub Desktop.
Very simple script for do automatic code deploys every time one client.js file generated with toaster is updated
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 | |
######################################################################################################## | |
### Launches toaster compiler and copies some code to another place every time "client.js" file ### | |
### (this file is auto-generated with toaster) changes. ### | |
### requires inotify tools: sudo apt-get install inotify-tools ### | |
### Font (http://superuser.com/questions/181517/how-to-execute-a-command-whenever-a-file-changes) ### | |
######################################################################################################## | |
toaster -wcd & | |
deploy () | |
{ | |
printf "Deploying client JS core ..." -n | |
cp ./client.js /destiny/client.js | |
printf " OK\n" | |
printf "Deploying templates ..." -n | |
if [ -d /destiny/templates ]; then | |
rm /destiny/templates -r | |
fi | |
printf "." -n | |
mkdir /destiny/templates | |
cp ./templates /destiny/templates/ -r | |
printf " OK\n" | |
} | |
while inotifywait -e close_write client.js; do deploy; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment