From e88d7aea857c1fcae02a3c98e450535eda711a48 Mon Sep 17 00:00:00 2001 From: Conor Luddy Date: Fri, 11 Nov 2016 12:45:24 +0000 Subject: [PATCH 1/2] Updated this to use the latest data available from the git-repo-info package. --- README.md | 9 +++++++++ config/environment.js | 13 +++++++++---- package.json | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 151e30a..b2d828b 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,15 @@ import config from '../config/environment'; ... console.log(config.currentRevision); + console.log(config.currentRevision); //=> will be the first 10 chars of the current sha + console.log(config.longRevision); //=> will be the current sha + console.log(config.tag); //=> will be the tag for the current sha (or `null` if no tag exists) + console.log(config.branch); //=> will be the current branch + console.log(config.committer); //=> will be the committer for the current sha + console.log(config.committerDate); //=> will be the commit date for the current sha + console.log(config.author); //=> will be the author for the current sha + console.log(config.authorDate); //=> will be the authored date for the current sha + console.log(config.commitMessage); //=> will be the commit message for the current sha ... ``` diff --git a/config/environment.js b/config/environment.js index 37360fd..eee9374 100644 --- a/config/environment.js +++ b/config/environment.js @@ -6,9 +6,14 @@ module.exports = function(/* environment, appConfig */) { var currentInfo = gitRepoInfo(); return { - currentRevision: currentInfo.abbreviatedSha, - longRevision: currentInfo.sha, - tag: currentInfo.tag, - branch: currentInfo.branch + currentRevision: currentInfo.abbreviatedSha, //=> will be the first 10 chars of the current sha + longRevision: currentInfo.sha, //=> will be the current sha + tag: currentInfo.tag, //=> will be the tag for the current sha (or `null` if no tag exists) + branch: currentInfo.branch, //=> will be the current branch + committer: currentInfo.committer, //=> will be the committer for the current sha + committerDate: currentInfo.committerDate, //=> will be the commit date for the current sha + author: currentInfo.author, //=> will be the author for the current sha + authorDate: currentInfo.authorDate, //=> will be the authored date for the current sha + commitMessage: currentInfo.commitMessage //=> will be the commit message for the current sha }; }; diff --git a/package.json b/package.json index 4b491d2..ddcab10 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,6 @@ "configPath": "tests/dummy/config" }, "dependencies": { - "git-repo-info": "^1.0.2" + "git-repo-info": "^1.3.1" } } From 062720d639b48074b43edd19c0878121b2f76851 Mon Sep 17 00:00:00 2001 From: Conor Luddy Date: Fri, 11 Nov 2016 12:46:28 +0000 Subject: [PATCH 2/2] Readme alignment tweak. --- README.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b2d828b..e3e106f 100644 --- a/README.md +++ b/README.md @@ -21,16 +21,15 @@ To access the new property, import the config whenever needed. import config from '../config/environment'; ... - console.log(config.currentRevision); console.log(config.currentRevision); //=> will be the first 10 chars of the current sha - console.log(config.longRevision); //=> will be the current sha - console.log(config.tag); //=> will be the tag for the current sha (or `null` if no tag exists) - console.log(config.branch); //=> will be the current branch - console.log(config.committer); //=> will be the committer for the current sha - console.log(config.committerDate); //=> will be the commit date for the current sha - console.log(config.author); //=> will be the author for the current sha - console.log(config.authorDate); //=> will be the authored date for the current sha - console.log(config.commitMessage); //=> will be the commit message for the current sha + console.log(config.longRevision); //=> will be the current sha + console.log(config.tag); //=> will be the tag for the current sha (or `null` if no tag exists) + console.log(config.branch); //=> will be the current branch + console.log(config.committer); //=> will be the committer for the current sha + console.log(config.committerDate); //=> will be the commit date for the current sha + console.log(config.author); //=> will be the author for the current sha + console.log(config.authorDate); //=> will be the authored date for the current sha + console.log(config.commitMessage); //=> will be the commit message for the current sha ... ```