Skip to content

Commit

Permalink
Merge pull request #397 from bertdeblock/update-readme
Browse files Browse the repository at this point in the history
Update README file
  • Loading branch information
bertdeblock authored Jan 5, 2023
2 parents c29005b + c119d20 commit 0a9533c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
ember-cli-app-version [![Build Status](https://travis-ci.org/ember-cli/ember-cli-app-version.svg?branch=master)](https://travis-ci.org/ember-cli/ember-cli-app-version) ![[EmberObserver Badge](http://emberobserver.com/addons/ember-cli-app-version)](http://emberobserver.com/badges/ember-cli-app-version.svg)
==============================================================================
# ember-cli-app-version

[![CI](https://github.com/ember-cli/ember-cli-app-version/workflows/CI/badge.svg)](https://github.com/ember-cli/ember-cli-app-version/actions?query=workflow%3ACI)
[![NPM Version](https://badge.fury.io/js/ember-cli-app-version.svg)](https://badge.fury.io/js/ember-cli-app-version)
[![Ember Observer Score](https://emberobserver.com/badges/ember-cli-app-version.svg)](https://emberobserver.com/addons/ember-cli-app-version)

Adds your Ember App's version to Info tab in Ember Inspector. The version is taken from your project's package.json#version.
If you add build metadata to the version, this addon will automatically append SHA to the end of the version.

## Compatibility

* Ember.js v3.28 or above
* Ember CLI v3.28 or above
* Node.js v14 or above

- Ember.js v3.28 or above
- Ember CLI v3.28 or above
- Node.js v14 or above

## Installation

```
ember install ember-cli-app-version
```


## Usage

![Ember Inspector Info Tab](https://www.evernote.com/shard/s51/sh/c2f52608-bc17-4d5c-ac76-dec044eeb2e2/2f08de0cfb77217502cfc3a9188d84bf/res/3fb1d3d9-d809-48f6-9d3b-6e9a4af29892/skitch.png?resizeSmall&width=832)
Expand All @@ -28,23 +29,23 @@ This addon provides `{{app-version}}` helper that allows you to show your curren

The addon has flags to display parts of the version:

* `{{app-version versionOnly=true}} // => 2.0.1`
* `{{app-version versionOnly=true showExtended=true}} // => 2.0.1-alpha.1`
* `{{app-version shaOnly=true}} // => <git SHA>`
- `{{app-version versionOnly=true}} // => 2.0.1`
- `{{app-version versionOnly=true showExtended=true}} // => 2.0.1-alpha.1`
- `{{app-version shaOnly=true}} // => <git SHA>`

Flags are `false` by default.

## Heroku

When running on Heroku the `.git` folder is not present, making it impossible to fetch the `git SHA`. A workaround for this is adding the below in your `config/environment.js`:

```
```js
// Heroku Git Hash support
if (process.env.SOURCE_VERSION) {
const pkg = require('../package.json');
const hash = process.env.SOURCE_VERSION.substr(0, 7);
ENV['ember-cli-app-version'] = {
version: `${pkg.version}+${hash}`
version: `${pkg.version}+${hash}`,
};
}
```
Expand All @@ -53,7 +54,6 @@ if (process.env.SOURCE_VERSION) {

See the [Contributing](CONTRIBUTING.md) guide for details.


## License

This project is licensed under the [MIT License](LICENSE.md).

0 comments on commit 0a9533c

Please sign in to comment.