-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX release] Use correct version number when used as an addon.
(cherry picked from commit b13a81b) Conflicts: package.json
- Loading branch information
Showing
4 changed files
with
23 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var path = require('path'); | ||
var existsSync = require('exists-sync'); | ||
var gitRepoInfo = require('git-repo-info'); | ||
|
||
module.exports = function() { | ||
var gitPath = path.join(__dirname, '..', '.git'); | ||
var packageVersion = require('../package.json').version; | ||
|
||
if (existsSync(gitPath)) { | ||
var info = gitRepoInfo(gitPath); | ||
|
||
return packageVersion + '+' + info.sha.slice(0, 10); | ||
} else { | ||
return packageVersion; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
var VERSION = require('git-repo-version')(10); | ||
var calculateVersion = require('./calculate-version'); | ||
var replace = require('broccoli-string-replace'); | ||
|
||
module.exports = function configFiles(tree) { | ||
return replace(tree, { | ||
files: ['*.{json,js}'], | ||
pattern: { | ||
match: /VERSION_STRING_PLACEHOLDER/g, | ||
replacement: VERSION | ||
replacement: calculateVersion() | ||
} | ||
}); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
var calculateVersion = require('./calculate-version'); | ||
var createFile = require('broccoli-file-creator'); | ||
|
||
var version; | ||
|
||
try { | ||
version = require('git-repo-version')(10); | ||
} catch (e) { | ||
version = require('../package').version; | ||
} | ||
|
||
module.exports = function() { | ||
return createFile('version.js', 'export default "' + version + '";'); | ||
return createFile('version.js', 'export default "' + calculateVersion() + '";'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters