You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
watch: {
'convert-model': {
files: [
'src/ch.actifsource.cloud.model/**/*.asr'
],
tasks: [],
options: {
spawn: true,
interrupt: false,
atBegin: true
},
}
...
grunt.event.on('watch', function(Action, FilePath, Target) {
if (Target === 'convert-model') {
switch (Action) {
case 'added':
case 'changed':
var TargetPath = convertModelTargetPath(FilePath);
grunt.log.writeln('Converting model file ' + FilePath + ' to: ' + TargetPath);
myOwnFileConverterFunction(FilePath,TargetPath);
break;
case 'deleted':
var TargetPath = convertModelTargetPath(FilePath);
grunt.log.writeln('Deleting model file from: ' + TargetPath);
break;
default:
grunt.log.writeln('Unknown action on ' + FilePath + ': ' + Action);
}
}
});
I want my watch:convert-model task to convert each target file using my own converter function at startup and then each as it changes. However, the event is only emitted on changes after the watch task started.
Request:
When atBegin is set, the event should also be called for each file which exists at the beginning. However, I am not sure, whether that should be seen as added or modified-action. It may even make sense to define a new action string, e.g. atBegin, then one could easily filter those out when atBegin is set, but the custom code shall not be executed for atBegin-Modifications.
The text was updated successfully, but these errors were encountered:
I have a task configured as follows:
I want my watch:convert-model task to convert each target file using my own converter function at startup and then each as it changes. However, the event is only emitted on changes after the watch task started.
Request:
When atBegin is set, the event should also be called for each file which exists at the beginning. However, I am not sure, whether that should be seen as
added
ormodified
-action. It may even make sense to define a new action string, e.g.atBegin
, then one could easily filter those out when atBegin is set, but the custom code shall not be executed for atBegin-Modifications.The text was updated successfully, but these errors were encountered: