diff options
author | Christoph (Sheogorath) Kern | 2018-11-11 19:00:03 +0100 |
---|---|---|
committer | GitHub | 2018-11-11 19:00:03 +0100 |
commit | ca9c4b3135e071bb599aad734930c5d1d339dc27 (patch) | |
tree | c7b2731235be1c08e3fc94cc85fd8ed21fac48e8 /lib/config/index.js | |
parent | 4e5e7df4f8ed5b4317ab9205ceb8c2b3231517ad (diff) | |
parent | bcc914a7735290b86e0df428aed75dabdf9f1eca (diff) |
Merge pull request #991 from SISheogorath/feature/fullversion
Add full version string (and no AGPL violation detection)
Diffstat (limited to 'lib/config/index.js')
-rw-r--r-- | lib/config/index.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/config/index.js b/lib/config/index.js index 501fdca3..4e1fa50d 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -8,6 +8,7 @@ const {merge} = require('lodash') const deepFreeze = require('deep-freeze') const {Environment, Permission} = require('./enum') const logger = require('../logger') +const {getGitCommit, getGitHubURL} = require('./utils') const appRootPath = path.resolve(__dirname, '../../') const env = process.env.NODE_ENV || Environment.development @@ -16,11 +17,17 @@ const debugConfig = { } // Get version string from package.json -const {version} = require(path.join(appRootPath, 'package.json')) +const {version, repository} = require(path.join(appRootPath, 'package.json')) + +const commitID = getGitCommit(appRootPath) +const sourceURL = getGitHubURL(repository.url, commitID || version) +const fullversion = commitID ? `${version}-${commitID}` : version const packageConfig = { version: version, - minimumCompatibleVersion: '0.5.0' + minimumCompatibleVersion: '0.5.0', + fullversion: fullversion, + sourceURL: sourceURL } const configFilePath = path.resolve(appRootPath, process.env.CMD_CONFIG_FILE || |