Skip to content

Commit d252f4d

Browse files
committed
Escaping the backups files
1 parent a54abd7 commit d252f4d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/utils.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ exports.process = function(opts) {
3333

3434
var handle_css = function(rootpath, backups) {
3535
find.eachfile(/\.css$/, rootpath, function(file) {
36+
if (path.basename(file, '.css').endsWith('bak'))return;
3637
var filepath = path.join(path.dirname(file), path.basename(file));
3738
var bakfilename = path.basename(file, '.css') + '-bak.css';
3839
var bakfilepath = path.join(path.dirname(file), bakfilename);
@@ -53,6 +54,7 @@ var handle_css = function(rootpath, backups) {
5354

5455
var handle_js = function(rootpath, backups) {
5556
find.eachfile(/\.js$/, rootpath, function(file) {
57+
if (path.basename(file, '.js').endsWith('bak'))return;
5658
var filepath = path.join(path.dirname(file), path.basename(file));
5759
var bakfilename = path.basename(file, '.js') + '-bak.js';
5860
var bakfilepath = path.join(path.dirname(file), bakfilename);
@@ -75,7 +77,7 @@ var handle_js = function(rootpath, backups) {
7577
var minify_img = function(rootpath) {
7678
imagemin([rootpath + '/**/*.{jpg,png}'], 'img', {
7779
plugins: [
78-
imageminJpegRecompress({method: 'smallfry'}),
80+
imageminJpegRecompress({method: 'smallfry'}),// change the plugin list here, if you want.
7981
imageminPngquant({quality: '65-80'})
8082
]
8183
}).then(files => {
@@ -87,7 +89,7 @@ var minify_img = function(rootpath) {
8789

8890
var minify_css = function(filepath) {
8991
compressor.minify({
90-
compressor: 'clean-css',
92+
compressor: 'clean-css',// change the compressor method here, if you want.
9193
input: filepath,
9294
output: filepath,
9395
options: {
@@ -106,7 +108,7 @@ var minify_css = function(filepath) {
106108

107109
var minify_js = function(filepath) {
108110
compressor.minify({
109-
compressor: 'gcc',
111+
compressor: 'gcc',// change the compressor method here, if you want.
110112
input: filepath,
111113
output: filepath,
112114
callback: function (err, min) {

0 commit comments

Comments
 (0)