mirror of
https://github.com/tabler/tabler-icons.git
synced 2025-08-28 08:11:00 +02:00
diff changelog
This commit is contained in:
73
gulpfile.js
73
gulpfile.js
@@ -201,7 +201,7 @@ gulp.task('optimize', function (cb) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('prepare-changelog', function(cb) {
|
gulp.task('changelog-commit', function(cb) {
|
||||||
cp.exec('git status', function(err, ret) {
|
cp.exec('git status', function(err, ret) {
|
||||||
let newIcons = [], modifiedIcons = [], renamedIcons = [];
|
let newIcons = [], modifiedIcons = [], renamedIcons = [];
|
||||||
|
|
||||||
@@ -234,6 +234,7 @@ gulp.task('prepare-changelog', function(cb) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
console.log(str);
|
console.log(str);
|
||||||
|
console.log('');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(modifiedIcons.length > 0) {
|
if(modifiedIcons.length > 0) {
|
||||||
@@ -249,27 +250,85 @@ gulp.task('prepare-changelog', function(cb) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
console.log(str);
|
console.log(str);
|
||||||
|
console.log('');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(renamedIcons.length > 0) {
|
if(renamedIcons.length > 0) {
|
||||||
let str = '';
|
console.log(`**Renamed icons: `);
|
||||||
str += `**Renamed icons: `;
|
|
||||||
|
|
||||||
renamedIcons.forEach(function(icon, i){
|
renamedIcons.forEach(function(icon, i){
|
||||||
str += `\`${icon[0]}\` renamed to \`${icon[1]}\``;
|
console.log(`- \`${icon[0]}\` renamed to \`${icon[1]}\``);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if((i + 1) <= renamedIcons.length - 1) {
|
cb();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('changelog-diff', function(cb) {
|
||||||
|
const version = p.version;
|
||||||
|
cp.exec(`git diff v${version} HEAD --name-status`, function(err, ret) {
|
||||||
|
|
||||||
|
let newIcons = [], modifiedIcons = [], renamedIcons = [];
|
||||||
|
|
||||||
|
ret.replace(/A\s+src\/_icons\/([a-z1-9-]+)\.svg/g, function (m, fileName) {
|
||||||
|
newIcons.push(fileName);
|
||||||
|
});
|
||||||
|
|
||||||
|
ret.replace(/M\s+src\/_icons\/([a-z1-9-]+)\.svg/g, function (m, fileName) {
|
||||||
|
modifiedIcons.push(fileName);
|
||||||
|
});
|
||||||
|
|
||||||
|
ret.replace(/R[0-9]+\s+src\/_icons\/([a-z1-9-]+)\.svg\s+src\/_icons\/([a-z1-9-]+).svg/g, function (m, fileNameBefore, fileNameAfter) {
|
||||||
|
renamedIcons.push([fileNameBefore, fileNameAfter]);
|
||||||
|
});
|
||||||
|
|
||||||
|
modifiedIcons = modifiedIcons.filter( function( el ) {
|
||||||
|
return newIcons.indexOf( el ) < 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
if(newIcons.length > 0) {
|
||||||
|
let str = '';
|
||||||
|
str += `${newIcons.length} new icons: `;
|
||||||
|
|
||||||
|
newIcons.forEach(function(icon, i){
|
||||||
|
str += `\`${icon}\``;
|
||||||
|
|
||||||
|
if((i + 1) <= newIcons.length - 1) {
|
||||||
str += ', '
|
str += ', '
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(str);
|
console.log(str);
|
||||||
|
console.log('');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(modifiedIcons.length > 0) {
|
||||||
|
let str = '';
|
||||||
|
str += `Fixed icons: `;
|
||||||
|
|
||||||
|
modifiedIcons.forEach(function(icon, i){
|
||||||
|
str += `\`${icon}\``;
|
||||||
|
|
||||||
|
if((i + 1) <= modifiedIcons.length - 1) {
|
||||||
|
str += ', '
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(str);
|
||||||
|
console.log('');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(renamedIcons.length > 0) {
|
||||||
|
console.log(`**Renamed icons: `);
|
||||||
|
|
||||||
|
renamedIcons.forEach(function(icon, i){
|
||||||
|
console.log(`- \`${icon[0]}\` renamed to \`${icon[1]}\``);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
cb();
|
cb();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('build-zip', function() {
|
gulp.task('build-zip', function() {
|
||||||
|
Reference in New Issue
Block a user