This addon adds a property to your config with current git info.
config.gitInfo
will return the following object:
gitInfo: {
sha: 'e7dfce8339e7dfce8339',
abbreviatedSha: 'e7dfce8339',
branch: 'master'
}
Get started by installing the addon using npm:
npm install ember-git-version --save
Once installed you now have access to current git info through a new config property config.gitInfo
which is an object with the following values:
gitInfo: {
sha: 'e7dfce8339e7dfce8339',
abbreviatedSha: 'e7dfce8339',
branch: 'master'
}
To access the property, import the config whenever needed.
import config from '../config/environment';
...
console.log(config.gitInfo.branch);
console.log(config.gitInfo.abbreviatedSha);
...
Note: The config import statement is a relative path.
Now you can make sure any issues are tracked against the correct git revision!
git clone
this repositorynpm install
bower install
ember server
- Visit your app at http://localhost:4200.
ember test
ember test --server
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.