[oozie] Allow workflow argument mixed with single and double quotes
@@ -25,13 +25,15 @@ ko.bindingHandlers.parseArguments = {
const bits = [];
let isInQuotes = false;
let tempStr = '';
+ let charQuote = null;
str
.replace(/<\/?arg>|<\/?command>/gi, ' ')
.replace(/\r?\n|\r/g, '')
.replace(/\s\s+/g, ' ')
.split('')
.forEach(char => {
- if (char === '"' || char === "'") {
+ if ((char === '"' || char === "'") && (!charQuote || charQuote == char)) {
+ charQuote = isInQuotes ? null : char;
isInQuotes = !isInQuotes;
} else if ((char === ' ' || char === '\n') && !isInQuotes && tempStr !== '') {
bits.push(tempStr);
