javascriptember-clibuild-toolsbroccolijs

git commit SHA hash in environment variable in ember-cli


How to expose the latest git commit SHA hash in an environment variable in config/environment.js in ember-cli


Solution

  • Found a solution with ember-cli-app-version

    https://www.npmjs.com/package/ember-cli-app-version

    so will get git hash in {{app-version}} helper. This addon will automatically append SHA to the end of the version.

    HTMLBAR template can use like

    {{app-version shaOnly=true}} // git SHA