mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-04-20 09:01:23 +00:00
fixed issue with multiple args for entrypoint
Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
This commit is contained in:
parent
69952a8f62
commit
652179bd8c
4 changed files with 19 additions and 5 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -43,11 +43,11 @@ class BuildahCli {
|
||||||
const args = ['config'];
|
const args = ['config'];
|
||||||
if (settings.entrypoint) {
|
if (settings.entrypoint) {
|
||||||
args.push('--entrypoint');
|
args.push('--entrypoint');
|
||||||
args.push(...settings.entrypoint);
|
args.push(this.convertArrayToStringArg(settings.entrypoint));
|
||||||
}
|
}
|
||||||
if (settings.port) {
|
if (settings.port) {
|
||||||
args.push('--port');
|
args.push('--port');
|
||||||
args.push(...settings.port);
|
args.push(settings.port);
|
||||||
}
|
}
|
||||||
args.push(container);
|
args.push(container);
|
||||||
return yield this.execute(args);
|
return yield this.execute(args);
|
||||||
|
@ -62,6 +62,13 @@ class BuildahCli {
|
||||||
return yield this.execute(args);
|
return yield this.execute(args);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
convertArrayToStringArg(args) {
|
||||||
|
let arrayAsString = '[';
|
||||||
|
args.forEach(arg => {
|
||||||
|
arrayAsString += `"${arg}",`;
|
||||||
|
});
|
||||||
|
return `${arrayAsString.slice(0, -1)}]`;
|
||||||
|
}
|
||||||
execute(args) {
|
execute(args) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (!this.executable) {
|
if (!this.executable) {
|
||||||
|
|
|
@ -59,7 +59,7 @@ export class BuildahCli implements Buildah {
|
||||||
const args: string[] = ['config'];
|
const args: string[] = ['config'];
|
||||||
if (settings.entrypoint) {
|
if (settings.entrypoint) {
|
||||||
args.push('--entrypoint');
|
args.push('--entrypoint');
|
||||||
args.push(...settings.entrypoint);
|
args.push(this.convertArrayToStringArg(settings.entrypoint));
|
||||||
}
|
}
|
||||||
if (settings.port) {
|
if (settings.port) {
|
||||||
args.push('--port');
|
args.push('--port');
|
||||||
|
@ -76,6 +76,13 @@ export class BuildahCli implements Buildah {
|
||||||
return await this.execute(args);
|
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> {
|
private async execute(args: string[]): Promise<CommandResult> {
|
||||||
if (!this.executable) {
|
if (!this.executable) {
|
||||||
|
|
Loading…
Reference in a new issue