1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-15 20:35:23 +03:00

Added support for building outside of a git repository.

This commit is contained in:
mikeller 2018-08-22 23:28:53 +12:00
parent 6b5a183c6b
commit 4e505fc7d0
3 changed files with 28 additions and 24 deletions

View file

@ -437,18 +437,21 @@ function buildNWApps(platforms, flavor, dir, done) {
}
function getChangesetId(done) {
git.exec({args : 'log -1 --format="%h"'}, function (err, stdout) {
if (err) {
throw err;
}
git.exec({args : 'log -1 --format="%h"'}, function (err, stdout) {
var version;
if (err) {
version = 'unsupported';
} else {
version = stdout.trim();
}
var versionData = { gitChangesetId: stdout.trim() }
var destFile = path.join(DIST_DIR, 'version.json');
var versionData = { gitChangesetId: version }
var destFile = path.join(DIST_DIR, 'version.json');
fs.writeFile(destFile, JSON.stringify(versionData) , function () {
done();
fs.writeFile(destFile, JSON.stringify(versionData) , function () {
done();
});
});
});
}
function start_debug(done) {