Skip to content

Commit

Permalink
Fixes semantic.json version overwriting package version
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Sep 2, 2015
1 parent fb0ebe2 commit 3d20d5e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tasks/config/project/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
var
requireDotFile = require('require-dot-file'),
config,
packageJSON,
npmPackage,
version
;

Expand All @@ -15,25 +15,26 @@ var
*******************************/

try {
config = requireDotFile('semantic.json');
config = requireDotFile('semantic.json');
}
catch(error) {}


try {
packageJSON = require('../../../package.json');
npmPackage = require('../../../package.json');
}
catch(error) {
// generate fake package
packageJSON = {
npmPackage = {
name: 'Unknown',
version: 'x.x'
};
}

// looks for version in config or package.json (whichever is available)
version = (config && config.version !== undefined)
? config.version
: packageJSON.version
version = (npmPackage && npmPackage.version !== undefined && npmPackage.name == 'semantic-ui')
? npmPackage.version
: config.version
;


Expand Down

0 comments on commit 3d20d5e

Please sign in to comment.