mirror of
https://github.com/deployphp/action.git
synced 2024-11-26 21:59:02 +00:00
fix: check if options were passed as arguments (#68)
before needlessly printing an error in the console, as an empty string is an invalid JSON string.
This commit is contained in:
parent
363bb1be96
commit
58c8341484
5
index.js
5
index.js
@ -110,12 +110,15 @@ async function dep() {
|
||||
let verbosity = core.getInput('verbosity')
|
||||
let options = []
|
||||
try {
|
||||
for (let [key, value] in Object.entries(JSON.parse(core.getInput('options')))) {
|
||||
let optionsArg = core.getInput('options')
|
||||
if (optionsArg !== '') {
|
||||
for (let [key, value] in Object.entries(JSON.parse(optionsArg))) {
|
||||
options.push('-o', `${key}=${value}`)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Invalid JSON in options')
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await $`php ${dep} ${cmd} --no-interaction ${ansi} ${verbosity} ${options}`
|
||||
|
Loading…
Reference in New Issue
Block a user