Answer the question
In order to leave comments, you need to log in
Change value of global variable from gulp task?
What you need:
Determine if a certain file exists in a certain directory.
If yes, then change the value of the variable, which will be used for another task with the gulp-if condition.
What happens:
There is a variable
AND there is a task that checks for the existence of a filevar bar = false;
gulp.task('default', function(cb) {
fs.stat('foo/bar.js', function(err, stat) {
return err == null ? bar = true : err.code;
});
console.log(bar); // false (почему не true? условие ведь проходит)
cb();
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question