//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+/* jshint node: true, browser: false */
/**
* @copyright 2014 Andrew Nicols
},
shifter;
+ grunt.log.ok("Running shifter on " + cwd);
args.push( path.normalize(__dirname + '/node_modules/shifter/bin/shifter'));
// Determine the most appropriate options to run with based upon the current location.
files.forEach(function (file) {
var p = path.join(directory, file);
- stat = fs.statSync(p);
+ var stat = fs.statSync(p);
if (!stat.isDirectory()) {
pending--;
} else {
grunt.event.on('watch', function(action, filepath) {
grunt.config('jshint.amd.src', filepath);
grunt.config('uglify.amd.files', [{ expand: true, src: filepath, rename: uglify_rename }]);
+ if (filepath.match('yui')) {
+ // Set the cwd to the base directory for yui modules which have changed.
+ cwd = filepath.split(path.sep + 'yui' + path.sep + 'src').shift();
+ } else {
+ cwd = process.env.PWD || process.cwd();
+ }
});
// Register NPM tasks.