From 7fd6076c3830c534a3e755df342f847d0bc90966 Mon Sep 17 00:00:00 2001 From: David Hiendl Date: Fri, 19 Jan 2024 15:00:20 +0100 Subject: [PATCH] use temporary file as workaround for calling fpm with arguments --- src/lib.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib.js b/src/lib.js index 59f1f49..aa624df 100644 --- a/src/lib.js +++ b/src/lib.js @@ -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) {