ITV/scala-pact

Unexpected exit behavior for verify and publish tasks

Closed this issue · 0 comments

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: