Skip to content

Commit

Permalink
fix(core): don't abort if providers needing manual init are ready
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Jun 4, 2019
1 parent 816ddf3 commit de15f1a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions garden-service/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export class ActionHelper implements TypeGuard {
/**
* Checks environment status and calls prepareEnvironment for each provider that isn't flagged as ready.
*
* If any of the getEnvironmentStatus handlers returns needManualInit=true, this throws and guides the user to
* run `garden init`
* If any of the getEnvironmentStatus handlers return ready=false AND needManualInit=true, this throws and guides
* the user to run `garden init`
*/
async prepareEnvironment(
{ force = false, pluginName, log, allowUserInput = false }:
Expand All @@ -153,13 +153,13 @@ export class ActionHelper implements TypeGuard {

const needManualInit = Object.entries(statuses)
.map(([name, status]) => ({ ...status, name }))
.filter(status => status.needManualInit === true)
.filter(status => status.ready === false && status.needManualInit === true)

if (!allowUserInput && needManualInit.length > 0) {
const names = needManualInit.map(s => s.name).join(", ")
const msgPrefix = needManualInit.length === 1
? `Provider ${names} has been updated or hasn't been configured, and requires manual initialization.`
: `Providers ${names} have been updated or haven't been configured, and require manual initialization.`
? `Provider ${names} has been updated or hasn't been configured, and requires manual initialization`
: `Providers ${names} have been updated or haven't been configured, and require manual initialization`

entry.setError()

Expand Down

0 comments on commit de15f1a

Please sign in to comment.