ITV / scala-pact

A Scala implementation of CDC using the Pact standard
Other
108 stars 54 forks source link

Unexpected exit behavior for verify and publish tasks #216

Closed solarmosaic-kflorence closed 3 years ago

solarmosaic-kflorence commented 3 years ago

The verify and publish tasks use sys.exit(0) on success, and sys.exit(1) on failure. This works fine when you run the command in isolation (e.g. sbt pactPublish), but if you try to run them as part of a sequence of events, either with addCommandAlias or Def.sequential, the sys.exit causes the process to end without running subsequent tasks. For example:

addCommandAlias("publishAll", ";pactPublish;publish;publishEcr")

Will only run pactPublish and then exit, even on success. Using sys.exit(1) on failure seems fine, but on success sys.exit should not be used at all.

See: