Open olafgleba opened 11 years ago
Hmm strange. I have not noticed a difference but I'll look into it.
Thanks in advance.
Some additional infos. options.event
are not set (implicit 'all'
). Tried it with setting them explicitly (['changed', 'added', 'deleted']
). No luck. No other options are set for the copy
watch task.
does not work grunt.event.on('watch', func) or
allJs: {
files: '<%=yeoman.main_js %>/**/*.js',
tasks: ['concat'],
options: {
spawn: false
}
}
or
allJs: {
files: '<%=yeoman.main_js %>/**/*.js',
tasks: ['concat'],
options: {
spawn: false,
event: ['changed', 'added', 'deleted']
}
},
works if I define in watch.js event
// On changed/added/deleted
this.on('all', function(status, filepath) {
grunt.event.emit('test:event:grunt', status, filepath);
filepath = path.relative(process.cwd(), filepath);
changedFiles[filepath] = status;
runTasks(i, target.tasks, options);
});
also works
fs.watch('somedir', function (event, filename) {
console.log('event is: ' + event);
if (filename) {
console.log('filename provided: ' + filename);
} else {
console.log('filename not provided');
}
});
The copy watch task runs whenever there are changes within a dedicated folder and trigger the folder content to be copied to another location (s. code:
copy:imagesSourceToApp
).As long as i add/remove new files, everything is fine.
But if i modify and save a image thats already exists within this folder, the related task is not triggered.
Is this a standard restriction as
watch
does only look out for changing filenames/folder status or is this a bug? I am not sure...Thanks for enlighten me ;-)