Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
fix(cli): deploy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Jan 29, 2019
1 parent 0577d18 commit b0a3c63
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions cli/packages/prisma-cli-core/src/commands/deploy/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,32 @@ ${chalk.gray(
this.out.exit(1)
}

const steps =
payload.steps || (payload.migration && payload.migration.steps) || []

if (
steps.length === 0 &&
(!payload.warnings || payload.warnings.length === 0)
) {
if (dryRun) {
this.out.log('There are no changes.')
} else {
this.out.log('Service is already up to date.')
}
return
}

if (steps.length > 0) {
const areChangesPotential =
dryRun || (payload.warnings && payload.warnings.length > 0)
this.out.log(
'\n' +
chalk.bold(areChangesPotential ? 'Potential changes:' : 'Changes:'),
)
this.out.migration.printMessages(steps)
this.out.log('')
}

if (payload.warnings && payload.warnings.length > 0) {
this.out.log(`${chalk.bold.yellow('\nWarnings:')}`)
this.out.migration.printWarnings(payload.warnings)
Expand All @@ -479,27 +505,6 @@ ${chalk.gray(
this.out.exit(1)
}
}

const steps =
payload.steps || (payload.migration && payload.migration.steps) || []

if (steps.length === 0) {
if (dryRun) {
this.out.log('There are no changes.')
} else {
this.out.log('Service is already up to date.')
}
return
}

if (steps.length > 0) {
// this.out.migrati
this.out.log(
'\n' + chalk.bold(dryRun ? 'Potential changees:' : 'Changes:'),
)
this.out.migration.printMessages(steps)
this.out.log('')
}
}

private printEndpoints(
Expand Down

0 comments on commit b0a3c63

Please sign in to comment.