From 01bb549d58a4e712e9e77087ffe768c0a91ed758 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 20 Jul 2016 20:21:28 +0100 Subject: [PATCH] Give branch in archive filenames --- README.md | 6 +++--- scripts/archive.js | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6224d546..49bfa49a 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Packaging scripts are provided for creating an installer and compressed archives Run the `scripts/installer.iss` [Inno Setup](http://www.jrsoftware.org/isinfo.php) script to build an installer executable in the `build` folder. If the unofficial Korean and Simplified Chinese Inno Setup translation files are installed alongside the official translation files, then the installer script will also offer those language options. If they are not found, the installer will be built without them. -The archive packaging script requires [Git for Windows](http://git-for-windows.github.io/) and [7-Zip](http://7-zip.org) to be installed. The script can be run using `node scripts/archive.js`, and will create `.7z` archives for LOOT and its API in the `build` folder. The archives will be given filenames using the output of `git describe --tags --long`. +The archive packaging script requires [Git for Windows](http://git-for-windows.github.io/) and [7-Zip](http://7-zip.org) to be installed. The script can be run using `node scripts/archive.js`, and will create `.7z` archives for LOOT and its API in the `build` folder. The archives will be given filenames using the output of `git describe --tags --long` and `git rev-parse --abbrev-ref HEAD`. ## Snapshot Builds @@ -50,7 +50,7 @@ Snapshot build archives are made available on [Dropbox](https://www.dropbox.com/ The archives are named in the following manner: ``` -LOOT --g.7z +LOOT --g-.7z ``` -For example `LOOT v0.7.0-alpha-2-10-gf6d7e80.7z` was built using the revision with shortened commit ID `f6d7e80`, which is `10` revisions after the revision tagged `v0.7.0-alpha-2`. +For example `LOOT v0.7.0-alpha-2-10-gf6d7e80-dev.7z` was built using the revision with shortened commit ID `f6d7e80`, which is `10` revisions after the revision tagged `v0.7.0-alpha-2`, and is on the `dev` branch. diff --git a/scripts/archive.js b/scripts/archive.js index 199b3aec..fed1b2f0 100644 --- a/scripts/archive.js +++ b/scripts/archive.js @@ -17,11 +17,18 @@ function vulcanize(rootPath) { } function getGitDescription() { - return String(childProcess.execFileSync('git', [ + const describe = String(childProcess.execFileSync('git', [ 'describe', '--tags', '--long', ])).slice(0, -1); + const branch = String(childProcess.execFileSync('git', [ + 'rev-parse', + '--abbrev-ref', + 'HEAD', + ])).slice(0, -1); + + return `${describe}-${branch}`; } function compress(sourcePath, destPath) {