Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated with additional info. #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +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
...

```
Expand Down
13 changes: 9 additions & 4 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
"configPath": "tests/dummy/config"
},
"dependencies": {
"git-repo-info": "^1.0.2"
"git-repo-info": "^1.3.1"
}
}