Skip to content

Instantly share code, notes, and snippets.

@AllenFang
Last active May 8, 2018 15:31
Show Gist options
  • Save AllenFang/733be58b394a7f58b5866852cf54bab5 to your computer and use it in GitHub Desktop.
Save AllenFang/733be58b394a7f58b5866852cf54bab5 to your computer and use it in GitHub Desktop.
function patchManifest(done) {
const tasks = countryList.map((countryName) => {
function patchManifestByCountry() {
return
gulp.src(`./build/${countryName}/manifest.json`)
.pipe(gulpJsonTransform((data) => {
data.homepage_url = .....;
return data;
}))
.pipe(gulp.dest(`./build/${countryName}/`));
}
// Use funciton.displayName to custom the task name
patchManifestByCountry.displayName = `patch_${countryName}_manifest`;
return patchManifestByCountry;
});
// The final task is still a anonymous function, you can fix it like above solution!
return gulp.series(...tasks, (seriesDone) => {
seriesDone();
done();
})();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment