throw exception with undefined containerRunner and docker

Signed-off-by: Matteo Silvestri <matteosilv@gmail.com>
This commit is contained in:
Matteo Silvestri
2022-09-15 17:38:16 +02:00
parent 2f612f38e3
commit 2e021cda37
@@ -143,7 +143,12 @@ export class TechdocsGenerator implements GeneratorBase {
);
break;
case 'docker':
await this.containerRunner!.runContainer({
if (this.containerRunner === undefined) {
throw new Error(
"Invalid state: containerRunner cannot be undefined when runIn is 'docker'",
);
}
await this.containerRunner.runContainer({
imageName:
this.options.dockerImage ?? TechdocsGenerator.defaultDockerImage,
args: ['build', '-d', '/output'],