Fix the root folder name inside CI-built archives

They use HEAD as the branch name, because CI scripting was only fixing
the names of the built archives.
This commit is contained in:
Oliver Hamlet
2016-07-24 21:39:45 +01:00
parent c0454fb496
commit 76f4982fd9
2 changed files with 11 additions and 4 deletions
+11 -1
View File
@@ -22,12 +22,22 @@ function getGitDescription() {
'--tags',
'--long',
])).slice(0, -1);
const branch = String(childProcess.execFileSync('git', [
let branch = String(childProcess.execFileSync('git', [
'rev-parse',
'--abbrev-ref',
'HEAD',
])).slice(0, -1);
/* On AppVeyor and Travis CI, a specific commit is checked out, so the branch
is HEAD. Use their stored branch value instead. */
if (branch === 'HEAD') {
if (process.env.APPVEYOR_REPO_BRANCH) {
branch = process.env.APPVEYOR_REPO_BRANCH;
} else if (process.env.TRAVIS_BRANCH) {
branch = process.env.TRAVIS_BRANCH;
}
}
return `${describe}_${branch}`;
}