From 46dfb92afd185c93f60ca90a72653f33d7cb18e8 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Thu, 13 Jun 2013 22:37:13 -0400 Subject: feat(ngdocs): provide support for user to jump between different versions of the angularjs documentation --- lib/grunt/plugins.js | 3 ++- lib/grunt/utils.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/grunt/plugins.js b/lib/grunt/plugins.js index b423b61f..ca2d6ec6 100644 --- a/lib/grunt/plugins.js +++ b/lib/grunt/plugins.js @@ -42,7 +42,8 @@ module.exports = function(grunt) { docs.on('exit', function(code){ if(code !== 0) grunt.fail.warn('Error creating docs'); grunt.file.expand(files).forEach(function(file){ - grunt.file.write(file, util.process(grunt.file.read(file), grunt.config('NG_VERSION'), false)); + var content = util.process(grunt.file.read(file), grunt.config('NG_VERSION'), false); + grunt.file.write(file, content); }); grunt.log.ok('docs created'); done(); diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index 3d2ab316..38533f27 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -16,8 +16,11 @@ module.exports = { var semver = match[1].split('.'); var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', ''); + var fullVersion = (match[1] + (match[2] ? '-' + hash : '')); + var numVersion = semver[0] + '.' + semver[1] + '.' + semver[2]; var version = { - full: (match[1] + (match[2] ? '-' + hash : '')), + number: numVersion, + full: fullVersion, major: semver[0], minor: semver[1], dot: semver[2], -- cgit v1.2.3