index.js
function() {
    let detectedVersion;

    if (this._options.useAppVersion && this._appVersion) {
      detectedVersion = this._appVersion;
    }

    if (!detectedVersion) {
      detectedVersion = this.parent.pkg.version;
    }

    if (detectedVersion && this._options.enabled) {
      const fileName = this._options.fileName;

      this.ui.writeLine(`Created ${fileName} with ${detectedVersion}`);
      return writeFile(fileName, detectedVersion);
    }
  }
function() {
    let detectedVersion;

    if (this._options.useAppVersion && this._appVersion) {
      detectedVersion = this._appVersion;
    }

    if (!detectedVersion) {
      detectedVersion = this.parent.pkg.version;
    }

    if (detectedVersion && this._options.enabled) {
      const fileName = this._options.fileName;

      this.ui.writeLine(`Created ${fileName} with ${detectedVersion}`);
      return writeFile(fileName, detectedVersion);
    }
  }
function ( ) { let detectedVersion ; if ( this . _options . useAppVersion && this . _appVersion ) { detectedVersion = this . _appVersion ; } if ( ! detectedVersion ) { detectedVersion = this . parent . pkg . version ; } if ( detectedVersion && this . _options . enabled ) { const fileName = this . _options . fileName ; this . ui . writeLine ( ` ${ fileName } ${ detectedVersion } ` ) ; return writeFile ( fileName , detectedVersion ) ; } }
Write version file

based on
- ember-cli-app-version if installed
- package.json of consuming application or
Write version file