Skip to content
This repository has been archived by the owner on Feb 28, 2020. It is now read-only.

Commit

Permalink
fix: starterOptions for usecase
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Compton committed Mar 1, 2018
1 parent 9f9a2da commit 8734d89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,15 @@ module.exports = Generator.extend({
this.options.bluemix = JSON.parse(this.options.bluemix)
}

if (typeof (this.options.starterOptions) === 'string') {
this.options.starterOptions = JSON.parse(this.options.starterOptions)
}

var appName = this.options.bluemix.name
var metrics = isTrue(this.options.metrics) || undefined
var docker = isTrue(this.options.docker) || undefined
var usecase = isTrue(this.options.enableUsecase) || undefined
var starterOptions = this.options.starterOptions || undefined

var web = (this.appType === 'web' || this.appType === 'bff' || undefined)
var hostSwagger = (this.appType === 'bff' || undefined)
Expand All @@ -149,7 +154,8 @@ module.exports = Generator.extend({
metrics: metrics,
repoType: 'clone',
healthcheck: healthcheck,
usecase: usecase
usecase: usecase,
starterOptions: starterOptions
}
} else if (this.options.init) {
// User passed the --init flag, so no prompts, just generate basic default scaffold
Expand Down
4 changes: 4 additions & 0 deletions refresh/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ module.exports = Generator.extend({
this.bluemix.server.name = this.bluemix.server.name || this.bluemix.name
this.bluemix.server.env = this.bluemix.server.env || {}

// StarterOptions configuration for Usecase enablement
this.starterOptions = this.spec.starterOptions || undefined

function isServiceProperty (value) {
if (Array.isArray(value)) {
// All elements of the service array must have a serviceInfo property
Expand Down Expand Up @@ -1325,6 +1328,7 @@ module.exports = Generator.extend({
if (!this.usecase) return
this.composeWith(require.resolve('generator-ibm-usecase-enablement'), {
force: this.force,
starterOptions : JSON.stringify(this.starterOptions),
bluemix: JSON.stringify(this.bluemix),
parentContext: {
injectDependency: dependency => { this.dependencies.push(dependency) }
Expand Down

0 comments on commit 8734d89

Please sign in to comment.