Skip to content

Commit b9de304

Browse files
committed
Default empty job stage to first defined stage
1 parent ba26742 commit b9de304

File tree

2 files changed

+28
-76
lines changed

2 files changed

+28
-76
lines changed

package-lock.json

+26-73
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/job.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,12 @@ export class Job {
6363
jobData = deepExtend.apply(this, deepExtendList);
6464
}
6565

66-
this.stage = jobData.stage || ".pre";
66+
this.stage = jobData.stage;
6767
this.scripts = [].concat(jobData.script || []);
6868

6969
this.stageIndex = stages.indexOf(this.stage);
7070
if (this.stageIndex === -1) {
71-
process.stderr.write(`${c.yellowBright(this.stage)} ${c.red(`not defined for`)} ${c.blueBright(this.name)}\n`);
72-
process.exit(1);
71+
this.stage = stages[0];
7372
}
7473

7574
const jobNameStr = this.getJobNameString();

0 commit comments

Comments
 (0)