-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: add execInteractiveCmd #294
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion
src/execCmd.ts
Outdated
@@ -303,3 +303,125 @@ export function execCmd<T = Collection>( | |||
} | |||
} | |||
} | |||
|
|||
function toString(arrOrString: string | string[]): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function toString(arrOrString: string | string[]): string { | |
function toString(arrOrString: Many<string>): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh, Many
is an unfortunate name for that
return arrOrString; | ||
} | ||
|
||
function toArray(arrOrString: Many<string>): string[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ensureArray
from kit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ensureArray
throws an error if the provided value isn't an array, which isn't what I'm doing here
QA Notes: ❓ I think this should accept a type 👎🏻 execCmd (non-interactive) doesn't require you to pass in cwd--it runs by default in the project dir. I don't want this one to behave so differently (and your example uses session.dir instead of
unrelated to this PR, but probably related to oclif parser changes for multiple? icon: Flags.integer({
char: 'i',
required: true,
min: 1,
max: 100,
default: 1,
summary: messages.getMessage('flags.icon.summary'),
description: messages.getMessage('flags.icon.description'),
}),
};
public async run(): Promise<GenerateTabResult> {
const { flags } = await this.parse(GenerateTab);
const tabPath = path.join(flags.directory, `${flags.object}.tab-meta.xml`);
const tab: GenerateTabResult['tab'] = {
customObject: true,
motif: tabDefs.find((tabDef) => tabDef.includes(`Custom${flags.icon}:`)),
|
@mshanemc I don't think it's possible to put a type on the return. The prompts go to stdout which makes parsing JSON impossible |
Adds
execInteractiveCmd
for executing interactive commands in NUTsUsage
@W-11787546@