From a026dc577c9f9207145343e3909e6ba651cfbe65 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 May 2019 16:14:42 +0300 Subject: [PATCH] diff fix --- diff.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/diff.js b/diff.js index 97e93e4874..eb3a178c0f 100644 --- a/diff.js +++ b/diff.js @@ -84,7 +84,14 @@ var deleteDirRecursively = function (path) { deleteDirRecursively(diffFilePath); deleteDirRecursively(upgradePath); +execute('git rev-parse --abbrev-ref HEAD', function (branch) { + if (branch !== 'master' && branch !== 'stable' && branch.indexOf('hotfix/') !== 0) { + console.log('\x1b[33m%s\x1b[0m', "Warning! You are on " + branch + " branch."); + } +}); + execute('git diff --name-only ' + versionFrom, function (stdout) { + if (!fs.existsSync(upgradePath)) { fs.mkdirSync(upgradePath); } @@ -121,7 +128,6 @@ execute('git diff --name-only ' + versionFrom, function (stdout) { deletedFileList.push(file); }); - execute('xargs -a ' + diffFilePath + ' cp --parents -t ' + upgradePath + '/files ' , function (stdout) { var d = new Date(); @@ -164,6 +170,8 @@ execute('git diff --name-only ' + versionFrom, function (stdout) { } fs.writeFileSync(upgradePath + '/manifest.json', JSON.stringify(manifest, null, ' ')); + + console.log("Upgrade package is built."); }); fs.unlinkSync(diffFilePath);