use temporary file as workaround for calling fpm with arguments

This commit is contained in:
David Hiendl 2024-01-19 15:00:20 +01:00
parent 90bbf0c643
commit 7fd6076c38

View File

@ -1,4 +1,5 @@
import * as core from '@actions/core';
import fs from 'fs';
const exec = require('@actions/exec');
@ -20,19 +21,17 @@ export async function installFpmViaRuby(debug) {
export async function executeFpmBuild(computedFpmArgs, debug) {
const userFpmArgs = core.getInput('fpm_args');
let fpmCmd = 'fpm'
const fpmCmd = 'fpm'
+ ' ' + computedFpmArgs
+ ' ' + userFpmArgs;
fpmCmd = fpmCmd.replaceAll('\n', ' ')
.replaceAll('\\n', ' ')
.replaceAll('\\', ' ');
fs.writeFileSync("/tmp/action-fpm-command-bash", fpmCmd);
if (debug) {
console.log('fpm command: ', fpmCmd);
}
await exec.exec(fpmCmd);
await exec.exec("bash /tmp/action-fpm-command-bash");
}
function isNonEmptyStr(str) {