-
Notifications
You must be signed in to change notification settings - Fork 128
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
Adding luis:application:import cmd #367
Conversation
|
packages/command/src/index.ts
Outdated
@@ -5,5 +5,6 @@ | |||
|
|||
import {CLIError, Command, flags} from './command' | |||
import utils from './utils' | |||
export {CLIError, Command, flags, utils} | |||
import ReadPipedStdin from './readpipeddata' |
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.
This is no needed, we are exposing this functionality as part of the command class. Please refer to luis:convert to see an example.
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.
refactored. after looking at it though, i still think it should live in utils because we have all other read / write / parse functionality there, so now there is this one-off. maybe there's a deeper inconsistency with how we achieve code reuse - through class inheritance vs utility functions. maybe we should have done it all one way or another. anyways...this works for now.
…osoft/botframework-cli into 306-luis-application-import
packages/luis/src/utils/index.ts
Outdated
@@ -18,6 +18,20 @@ const filterConfig = (config: any, prefix: string) => { | |||
}, {}) | |||
} | |||
|
|||
const getInputFromFileOrStdin = async (args: any): Promise<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.
I dont think we have to do this here
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.
refactored
@@ -55,6 +69,10 @@ const processInputs = async (flags: any, flagLabels: string[], configDir: string | |||
flagLabels | |||
.filter(flag => flag !== 'help') | |||
.map((flag: string) => { | |||
if (flag === 'in') { |
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.
Should we exclude this flag?
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.
meaning remove it from input processing in utils? i don't think so - i think we should stay consistent
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.
leaving as is
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.
CIL
} | ||
|
||
async getImportJSON(input: string) { | ||
if (input) { |
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.
Stdin should override flags.in
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.
If no stdin or flags.in value passed, CLIError should be thrown asking the user to provide input
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.
added error & unit test
…osoft/botframework-cli into 306-luis-application-import
fixes #367 |
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.
CIL
Hi! When this changes will be available on npm? |
No description provided.