Skip to content

Commit

Permalink
fix: error messages only when defaultImage is explicitly set
Browse files Browse the repository at this point in the history
  • Loading branch information
Anon committed Nov 7, 2024
1 parent 4b3049b commit 7fb0a2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"depcheck": "1.x.x",
"esbuild": "^0.24.0",
"eslint": "8.x.x",
"jest": "29.x.x",
"jest": "^29.x.x",
"jest-when": "3.x.x",
"nodemon": "^3.1.1",
"ts-jest": "29.x.x",
Expand Down Expand Up @@ -187,4 +187,4 @@
"src/**/*.js",
"src/**/*.json"
]
}
}
8 changes: 6 additions & 2 deletions src/argv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export class Argv {
writeStreams?.stderr(chalk`{black.bgYellowBright WARN } --shell-isolation does not work with --no-shell-executor-no-image\n`);
}

if (argv.defaultImage && argv.shellIsolation) {
if (argv.defaultImageExplicitlySet && argv.shellIsolation) {
writeStreams?.stderr(chalk`{black.bgYellowBright WARN } --default-image does not work with --shell-isolation=true\n`);
}

if (argv.defaultImage && argv.shellExecutorNoImage) {
if (argv.defaultImageExplicitlySet && argv.shellExecutorNoImage) {
writeStreams?.stderr(chalk`{black.bgYellowBright WARN } --default-image does not work with --shell-executor-no-image=true\n`);
}

Expand Down Expand Up @@ -286,6 +286,10 @@ export class Argv {
return this.map.get("defaultImage") ?? "docker.io/ruby:3.1";
}

get defaultImageExplicitlySet (): boolean {
return this.map.get("defaultImage") ?? false;
}

get maximumIncludes (): number {
return this.map.get("maximumIncludes") ?? 150; // https://docs.gitlab.com/ee/administration/settings/continuous_integration.html#maximum-includes
}
Expand Down

0 comments on commit 7fb0a2c

Please sign in to comment.