Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: fix/missing quotes for itemSeparator #127

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/models/helpers/CommandLineParsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export class CommandLineParsers {

const prefix = input.inputBinding.prefix || "";
const separator = input.inputBinding.separate !== false ? " " : "";
let itemSeparator = typeof input.inputBinding.itemSeparator === "string" ?
input.inputBinding.itemSeparator : " ";
const itemSeparatorEnabled = typeof input.inputBinding.itemSeparator === "string";
let itemSeparator = itemSeparatorEnabled ? input.inputBinding.itemSeparator : " ";

// Cannot import SBDraft2CommandLineBindingModel since its then a circular dependency
// So check if its SBDraft2 by checking if does not have flag hasSecondaryFiles
Expand Down Expand Up @@ -146,7 +146,9 @@ export class CommandLineParsers {
return CommandLinePrepare.prepare(item, value, value[item.id]) as Promise<CommandLinePart>;
})
) as Promise<any>).then((res: Array<CommandLinePart>) => {
return new CommandLinePart(prefix + separator + res.map(part => part.value).join(itemSeparator), cmdType, loc);
const valueJoined = res.map(part => part.value).join(itemSeparator);
const value = itemSeparatorEnabled ? `'${valueJoined}'` : valueJoined;
return new CommandLinePart(prefix + separator + value, cmdType, loc);
});

}
Expand Down