From 4ee978ae61bdefee380d9d4fbb7a3b936b2a8f54 Mon Sep 17 00:00:00 2001 From: Thorrak Date: Fri, 23 Apr 2021 10:25:03 -0400 Subject: [PATCH] Break out assembly of dict --- post.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/post.js b/post.js index 163f531..4b3ccb9 100644 --- a/post.js +++ b/post.js @@ -4,14 +4,19 @@ const fs = require('fs'); try { const composeFile = core.getInput('compose-file'); - const downOptions = core.getInput('down-options').split(" "); + const downOptionsString = core.getInput('down-options'); + + if (downOptionsString.length > 0) + let options = { config: composeFile, log: true, commandOptions: downOptionsString.split(" ") }; + else + let options = { config: composeFile, log: true}; if (!fs.existsSync(composeFile)) { console.log(`${composeFile} not exists`); return } - compose.down({ config: composeFile, log: true, commandOptions: downOptions }) + compose.down(options) .then( () => { console.log('compose removed')}, err => { core.setFailed(`compose down failed ${err}`)}