Closed fedulovivan closed 8 years ago
https://github.com/hparra/gulp-rename#usage -> rename via function
@fedulovivan gulp.dest
has an overwrite option which you can set to false
@contra Probably this is some kind undocumented dest option.
$ gulp -v
[10:09:06] CLI version 3.9.0
[10:09:06] Local version 3.9.0
In fact these two options below does not work:
.pipe(gulp.dest("config/", {overwrite: false}))
.pipe(gulp.dest("config/", {override: false}))
@fedulovivan It is in 4.0 branch -> https://github.com/gulpjs/gulp/blob/4.0/docs/API.md#optionsoverwrite
@heikki Right, thanks! This new option actually listed in 4.0.0 change log. update: is it turned out gulp v4 is currently alpha
I would also like this feature but Gulp 4 is still in alpha?
Can someone post an example of how to do this without using the new feature? I looked at rename and it's not what I'm after.
Code:
gulp.task("steps", function stepsTask(cb) {
var GulpYaddaSteps = require('gulp-yadda-steps');
gulp.src(__dirname + '/tests/features/**/*.feature')
.pipe(new GulpYaddaSteps())
.pipe(gulp.dest(__dirname + '/tests/steps/, {overwrite: false}'));
});
Expected: Existing files are not overwritten Actual: Existing files are overwritten
If you would like to see two solutions check this out.
http://stackoverflow.com/questions/38827441/gulp-write-file-if-none-exist/38828128#38828128
Hello, is it possible to perform additional check before writing destination file, and omit renaming operation if destination file already exists?
My usecase is creating real config files from samples: