-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Sometimes the command to execute depends on state other than the filename. For example, you might want to execute different commands if the target file already exist or if it doesn't. The current template format does not allow for this kind of usage.
One simple solution to support this usage is that exec accept a function:
gulp.src(myfiles)
.pipe(
exec(file => accessAsync(file.path, F_OK)
.then(() => 'command to execute if file exists')
.catch(() => 'command to execute if file does not exist'))
);I can put together a PR to support this over the weekend.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels