|
|
|
@ -44,17 +44,17 @@ if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function removeExceptGitDir(dir) {
|
|
|
|
|
fs2.readdir(dir, function(err, list) {
|
|
|
|
|
if (err) return done(err);
|
|
|
|
|
// readdirSync
|
|
|
|
|
const list = fs2.readdirSync(dir)
|
|
|
|
|
// if (err) return done(err);
|
|
|
|
|
var pending = list.length;
|
|
|
|
|
if (!pending) return done(null, results);
|
|
|
|
|
// if (!pending) return done(null, results);
|
|
|
|
|
list.forEach(function(file) {
|
|
|
|
|
if (file.indexOf('.git') == -1) {
|
|
|
|
|
file = path.resolve(dir, file);
|
|
|
|
|
fs.remove(file)
|
|
|
|
|
fs.removeSync(file)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// First, read the current file sizes in build directory.
|
|
|
|
@ -202,6 +202,14 @@ function generateNewIndexJsp() {
|
|
|
|
|
|
|
|
|
|
fs2.writeFile(outputPath, result, 'utf8', function (err) {
|
|
|
|
|
if (err) return console.log(err);
|
|
|
|
|
commitAndPush();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function commitAndPush() {
|
|
|
|
|
var exec = require('child_process').exec;
|
|
|
|
|
function puts(error, stdout, stderr) { console.log(stdout) }
|
|
|
|
|
var options = {cwd:"./build"};
|
|
|
|
|
exec("git status && git commit -am 'b' && git push", options, puts);
|
|
|
|
|
}
|