fixed issue with multiple args for entrypoint

Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
This commit is contained in:
Luca Stocchi 2020-11-07 13:25:52 +01:00
parent 69952a8f62
commit 652179bd8c
No known key found for this signature in database
GPG key ID: 930BB00F3FCF30A4
4 changed files with 19 additions and 5 deletions

View file

@ -59,7 +59,7 @@ export class BuildahCli implements Buildah {
const args: string[] = ['config'];
if (settings.entrypoint) {
args.push('--entrypoint');
args.push(...settings.entrypoint);
args.push(this.convertArrayToStringArg(settings.entrypoint));
}
if (settings.port) {
args.push('--port');
@ -76,6 +76,13 @@ export class BuildahCli implements Buildah {
return await this.execute(args);
}
private convertArrayToStringArg(args: string[]): string {
let arrayAsString = '[';
args.forEach(arg => {
arrayAsString += `"${arg}",`;
});
return `${arrayAsString.slice(0, -1)}]`;
}
private async execute(args: string[]): Promise<CommandResult> {
if (!this.executable) {