F #3951: fix prepend command (#698)

This commit is contained in:
Jorge Miguel Lobo Escalona authored and GitHub committed 2021-01-27 19:05:17 +01:00
1 parent 01585cbf31
commit 55adb8c64c
2 files changed
+18 -3

No files matched your search

@@ -228,10 +228,15 @@ const addPrependCommand = (command = '', resource = '') => {
let newRsc = rsc
if (prependCommand) {
let splitPrepend = prependCommand.split(' ')
const splitPrepend = prependCommand.split(' ').filter(el => el !== '')
newCommand = splitPrepend[0]
splitPrepend = splitPrepend.splice(1)
newRsc = [...splitPrepend, command, ...rsc].filter(el => el !== '')
// remove command
splitPrepend.shift()
// stringify the rest of the parameters
const stringifyRestCommand = [command, ...rsc].join(' ')
newRsc = [...splitPrepend, stringifyRestCommand]
}
return {
@@ -571,6 +571,16 @@ const configureProvision = (res = {}, next = () => undefined, params = {}, userD
const command = 'configure'
const endpoint = getEndpoint()
const authCommand = ['--user', user, '--password', password]
const paramsCommand = [command, params.id, '--debug', '--json', '--fail_cleanup', '--batch', '--force', ...authCommand, ...endpoint]
let lastLine = ''
const uuid = v4()
const emit = message => {
message.toString().split(/\r|\n/).map(line => {
if (line) {
lastLine = line
publish(defaultCommandProvision, { id: params.id, data: lastLine, command: command, commandId: uuid })
}
})
const paramsCommand = [command, params.id, '--debug', '--json', '--force', '--fail_cleanup', '--batch', ...authCommand, ...endpoint]
// get Log file