diff --git a/dist/index.js b/dist/index.js index adfee3a..fe6c47f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -36631,6 +36631,7 @@ var import_build = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((expo var { VERSION, YAML, argv, dotenv, echo, expBackoff, fetch, fs, glob, globby, minimist, nothrow, parseArgv, question, quiet, retry, sleep, spinner, stdin, tempdir, tempfile, tmpdir, tmpfile, updateArgv, version, versions, $, Fail, ProcessOutput, ProcessPromise, bus, cd, chalk, defaults, kill, log, os: os$1, path, ps, quote, quotePowerShell, resolveDefaults, syncProcessCwd, useBash, usePowerShell, usePwsh, which, within } = globalThis.Deno ? globalThis.require("./index.cjs") : import_build; //#endregion //#region src/index.ts +$.verbose = true; (async function main() { try { await ssh(); @@ -36707,10 +36708,13 @@ async function dep() { bin = "deployer.phar"; } const cmd = getInput("dep").split(" "); - let recipe = getInput("recipe"); - if (recipe !== "") recipe = `--file=${recipe}`; + const recipeArgs = []; + const recipeInput = getInput("recipe"); + if (recipeInput !== "") recipeArgs.push(`--file=${recipeInput}`); const ansi = getBooleanInput("ansi") ? "--ansi" : "--no-ansi"; - const verbosity = getInput("verbosity"); + const verbosityArgs = []; + const verbosityInput = getInput("verbosity"); + if (verbosityInput !== "") verbosityArgs.push(verbosityInput); const options = []; try { const optionsArg = getInput("options"); @@ -36722,7 +36726,7 @@ async function dep() { const phpBinArg = getInput("php-binary"); if (phpBinArg !== "") phpBin = phpBinArg; try { - await $`${phpBin} ${bin} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}`; + await $`${phpBin} ${bin} ${cmd} ${recipeArgs} --no-interaction ${ansi} ${verbosityArgs} ${options}`; } catch (err) { setFailed(`Failed: dep ${cmd}`); } diff --git a/src/index.ts b/src/index.ts index 4247256..3864887 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,8 @@ import * as core from '@actions/core' import { $, fs, cd } from 'zx' +$.verbose = true + interface ComposerLock { packages?: Array<{ name: string; version: string }> 'packages-dev'?: Array<{ name: string; version: string }> @@ -129,13 +131,18 @@ async function dep(): Promise { } const cmd = core.getInput('dep').split(' ') - let recipe = core.getInput('recipe') - if (recipe !== '') { - recipe = `--file=${recipe}` + const recipeArgs: string[] = [] + const recipeInput = core.getInput('recipe') + if (recipeInput !== '') { + recipeArgs.push(`--file=${recipeInput}`) } const ansi = core.getBooleanInput('ansi') ? '--ansi' : '--no-ansi' - const verbosity = core.getInput('verbosity') + const verbosityArgs: string[] = [] + const verbosityInput = core.getInput('verbosity') + if (verbosityInput !== '') { + verbosityArgs.push(verbosityInput) + } const options: string[] = [] try { const optionsArg = core.getInput('options') @@ -155,7 +162,7 @@ async function dep(): Promise { } try { - await $`${phpBin} ${bin} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}` + await $`${phpBin} ${bin} ${cmd} ${recipeArgs} --no-interaction ${ansi} ${verbosityArgs} ${options}` } catch (err) { core.setFailed(`Failed: dep ${cmd}`) }