From 90bbf0c64396d01236ba53662c76c517cdcb1384 Mon Sep 17 00:00:00 2001 From: David Hiendl Date: Fri, 19 Jan 2024 14:46:55 +0100 Subject: [PATCH] fix newline issues when passing args directly to binary instead of bash --- dist/index.js | 6 +++++- src/lib.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index ca84006..1f85efc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -30214,10 +30214,14 @@ async function installFpmViaRuby(debug) { async function executeFpmBuild(computedFpmArgs, debug) { const userFpmArgs = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('fpm_args'); - const fpmCmd = 'fpm' + let fpmCmd = 'fpm' + ' ' + computedFpmArgs + ' ' + userFpmArgs; + fpmCmd = fpmCmd.replaceAll('\n', ' ') + .replaceAll('\\n', ' ') + .replaceAll('\\', ' '); + if (debug) { console.log('fpm command: ', fpmCmd); } diff --git a/src/lib.js b/src/lib.js index 08195c2..59f1f49 100644 --- a/src/lib.js +++ b/src/lib.js @@ -20,10 +20,14 @@ export async function installFpmViaRuby(debug) { export async function executeFpmBuild(computedFpmArgs, debug) { const userFpmArgs = core.getInput('fpm_args'); - const fpmCmd = 'fpm' + let fpmCmd = 'fpm' + ' ' + computedFpmArgs + ' ' + userFpmArgs; + fpmCmd = fpmCmd.replaceAll('\n', ' ') + .replaceAll('\\n', ' ') + .replaceAll('\\', ' '); + if (debug) { console.log('fpm command: ', fpmCmd); }