diff fix
This commit is contained in:
@@ -57,10 +57,8 @@ var currentPath = path.dirname(fs.realpathSync(__filename));
|
||||
var buildRelPath = 'build/EspoCRM-' + version;
|
||||
var buildPath = currentPath + '/' + buildRelPath;
|
||||
var diffFilePath = currentPath + '/build/diff';
|
||||
|
||||
var upgradePath = currentPath + '/build/EspoCRM-upgrade-' + acceptedVersionName + '-to-' + version;
|
||||
|
||||
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
function execute(command, callback) {
|
||||
@@ -69,6 +67,23 @@ function execute(command, callback) {
|
||||
});
|
||||
};
|
||||
|
||||
var deleteDirRecursively = function (path) {
|
||||
if (fs.existsSync(path)) {
|
||||
fs.readdirSync(path).forEach(function(file, index) {
|
||||
var curPath = path + "/" + file;
|
||||
if (fs.lstatSync(curPath).isDirectory()) {
|
||||
deleteDirRecursively(curPath);
|
||||
} else {
|
||||
fs.unlinkSync(curPath);
|
||||
}
|
||||
});
|
||||
fs.rmdirSync(path);
|
||||
}
|
||||
};
|
||||
|
||||
deleteDirRecursively(diffFilePath);
|
||||
deleteDirRecursively(upgradePath);
|
||||
|
||||
execute('git diff --name-only ' + versionFrom, function (stdout) {
|
||||
if (!fs.existsSync(upgradePath)) {
|
||||
fs.mkdirSync(upgradePath);
|
||||
@@ -149,15 +164,9 @@ execute('git diff --name-only ' + versionFrom, function (stdout) {
|
||||
}
|
||||
|
||||
fs.writeFileSync(upgradePath + '/manifest.json', JSON.stringify(manifest, null, ' '));
|
||||
|
||||
});
|
||||
|
||||
fs.unlinkSync(diffFilePath);
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user