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) {