aboutsummaryrefslogtreecommitdiff
path: root/gulpfile.js
diff options
context:
space:
mode:
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/gulpfile.js b/gulpfile.js
index 1817ff9d..d461eecd 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -626,17 +626,17 @@ const setVersions = function(version, files) {
if (fs.existsSync(`src/_icons/${file}.svg`)) {
let svgFile = fs.readFileSync(`src/_icons/${file}.svg`).toString();
-
+
if(!svgFile.match(/version: ([0-9.]+)/i)) {
svgFile = svgFile.replace(/---\n<svg>/i, function(m){
return `version: ${version}\n${m}`;
});
-
+
fs.writeFileSync(`src/_icons/${file}.svg`, svgFile);
} else {
console.log(`File ${file} already has version`);
}
-
+
} else {
console.log(`File ${file} doesn't exists`);
}
@@ -652,7 +652,7 @@ gulp.task('update-icons-version', function (cb) {
cp.exec(`git diff v${version} HEAD --name-status`, function (err, ret) {
let newIcons = [];
-
+
ret.replace(/[A]\s+src\/_icons\/([a-z0-9-]+)\.svg/g, function (m, fileName) {
newIcons.push(fileName);
});
@@ -674,7 +674,7 @@ gulp.task('import-tags', function(cb) {
}))
.on('data', (row) => {
console.log(row[0], row[1]);
-
+
const filename = `src/_icons/${row[0]}.svg`;
let data = fs.readFileSync(filename).toString();
@@ -685,7 +685,7 @@ gulp.task('import-tags', function(cb) {
return headerContent;
});
-
+
fs.writeFileSync(filename, data);
})