mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
chore(package.json): kill version.yaml in favor of package.json
all versioning info is now in package.json and that's where the build scripts read it from
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
var fs = require('fs');
|
||||
var shell = require('shelljs');
|
||||
var yaml = require('yaml-js');
|
||||
var grunt = require('grunt');
|
||||
var spawn = require('child_process').spawn;
|
||||
|
||||
@@ -12,8 +11,8 @@ module.exports = {
|
||||
|
||||
|
||||
getVersion: function(){
|
||||
var versionYaml = yaml.load(fs.readFileSync('version.yaml', 'UTF-8'));
|
||||
var match = versionYaml.version.match(/^([^\-]*)(-snapshot)?$/);
|
||||
var package = JSON.parse(fs.readFileSync('package.json', 'UTF-8'));
|
||||
var match = package.version.match(/^([^\-]*)(-snapshot)?$/);
|
||||
var semver = match[1].split('.');
|
||||
var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', '');
|
||||
|
||||
@@ -22,8 +21,8 @@ module.exports = {
|
||||
major: semver[0],
|
||||
minor: semver[1],
|
||||
dot: semver[2],
|
||||
codename: versionYaml.codename,
|
||||
stable: versionYaml.stable
|
||||
codename: package.codename,
|
||||
cdn: package.cdnVersion
|
||||
};
|
||||
|
||||
return version;
|
||||
@@ -89,7 +88,7 @@ module.exports = {
|
||||
.replace(/"NG_VERSION_MAJOR"/, NG_VERSION.major)
|
||||
.replace(/"NG_VERSION_MINOR"/, NG_VERSION.minor)
|
||||
.replace(/"NG_VERSION_DOT"/, NG_VERSION.dot)
|
||||
.replace(/"NG_VERSION_STABLE"/, NG_VERSION.stable)
|
||||
.replace(/"NG_VERSION_CDN"/, NG_VERSION.cdn)
|
||||
.replace(/"NG_VERSION_CODENAME"/, NG_VERSION.codename);
|
||||
if (strict !== false) processed = this.singleStrict(processed, '\n\n', true);
|
||||
return processed;
|
||||
|
||||
Reference in New Issue
Block a user