Created
October 5, 2015 20:41
-
-
Save nWidart/33da54f27e7372cc4626 to your computer and use it in GitHub Desktop.
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
var gulp = require('gulp'), | |
shell = require('gulp-shell'), | |
gutil = require('gulp-util'); | |
var publishAssets = function (evt) { | |
var changedFilePath = evt.path; | |
var splitFilePath = changedFilePath.split('/'); | |
var moduleLocation = splitFilePath.indexOf('Modules') + 1; | |
var moduleName = splitFilePath[moduleLocation]; | |
gutil.log('File ' + changedFilePath + ' changed, publishing ' + moduleName + ' module.'); | |
gulp.src('').pipe(shell(['php artisan module:publish ' + moduleName + ' --market=pt'])); | |
} | |
gulp.task('default', ['watch']); | |
gulp.task('watch', function () { | |
gulp.watch(['Modules/*/Assets/**/*']) | |
.on('change', function (evt) { | |
publishAssets(evt); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment