Forked from arnaudbreton/rsync-auto grunt alternative.coffee
Last active
August 29, 2015 14:07
-
-
Save michaellopez/56c703c51212bb6b0d23 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
terminal = require('color-terminal') | |
log = (error, stdout, stderr, cb) -> | |
if error | |
terminal.color('red').write stdout | |
else | |
terminal.color('green').write stdout | |
cb() | |
module.exports = (grunt) -> | |
grunt.loadNpmTasks 'grunt-contrib-watch' # https://github.com/gruntjs/grunt-contrib-watch | |
grunt.loadNpmTasks 'grunt-shell' # https://github.com/sindresorhus/grunt-shell | |
grunt.initConfig | |
vagrantPath: '<path to .vagrant dir>' # TO MODIFY | |
watch: | |
src: | |
options: | |
spawn: false | |
files: [ | |
'some paths...' # TO MODIFY | |
] | |
tasks: 'shell:vagrant_rsync' | |
shell: | |
vagrant_rsync: | |
options: | |
callback: log | |
command: 'cd <%= vagranPath %> && vagrant rsync' # --debug to get full logs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment