Skip to content

Commit ceda23d

Browse files
committed
fix: Set exitCode based upon compile status of the project
Fixes #27
1 parent 613bef4 commit ceda23d

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

commands/Build.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,23 @@ export default class Build extends BaseCommand {
8787
const stopOnError = !this.ignoreTsErrors
8888

8989
try {
90-
if (this.production) {
91-
await new Compiler(
92-
this.application.appRoot,
93-
this.encoreArgs,
94-
this.assets,
95-
this.logger,
96-
this.tsconfig
97-
).compileForProduction(stopOnError, this.client)
98-
} else {
99-
await new Compiler(
100-
this.application.appRoot,
101-
this.encoreArgs,
102-
this.assets,
103-
this.logger,
104-
this.tsconfig
105-
).compile(stopOnError)
90+
const compiler = new Compiler(
91+
this.application.appRoot,
92+
this.encoreArgs,
93+
this.assets,
94+
this.logger,
95+
this.tsconfig
96+
)
97+
98+
const compiled = this.production
99+
? await compiler.compileForProduction(stopOnError, this.client)
100+
: await compiler.compile(stopOnError)
101+
102+
/**
103+
* Set exitCode based upon the compiled status
104+
*/
105+
if (!compiled) {
106+
this.exitCode = 1
106107
}
107108
} catch (error) {
108109
this.logger.fatal(error)

0 commit comments

Comments
 (0)