This repository was archived by the owner on Jan 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
src/commands/luis/generate
test/parser/luisgen/obj/Debug/netcoreapp2.1 Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ export default class LuisGenerateCs extends Command {
3434 let space = 'Luis'
3535 let stdInput = await this . readStdin ( )
3636
37- const pathPrefix = path . isAbsolute ( flags . in ) ? '' : process . cwd ( )
37+ if ( ! flags . in && ! stdInput ) {
38+ throw new CLIError ( 'Missing input. Please use stdin or pass a file location with --in flag' )
39+ }
40+
41+ const pathPrefix = flags . in && path . isAbsolute ( flags . in ) ? '' : process . cwd ( )
3842 let app : any
3943 try {
4044 app = stdInput ? JSON . parse ( stdInput as string ) : await fs . readJSON ( path . join ( pathPrefix , flags . in ) )
Original file line number Diff line number Diff line change @@ -33,7 +33,11 @@ export default class LuisGenerateTs extends Command {
3333 const { flags} = this . parse ( LuisGenerateTs )
3434 let stdInput = await this . readStdin ( )
3535
36- const pathPrefix = path . isAbsolute ( flags . in ) ? '' : process . cwd ( )
36+ if ( ! flags . in && ! stdInput ) {
37+ throw new CLIError ( 'Missing input. Please use stdin or pass a file location with --in flag' )
38+ }
39+
40+ const pathPrefix = flags . in && path . isAbsolute ( flags . in ) ? '' : process . cwd ( )
3741 let app : any
3842 try {
3943 app = stdInput ? JSON . parse ( stdInput as string ) : await fs . readJSON ( path . join ( pathPrefix , flags . in ) )
You can’t perform that action at this time.
0 commit comments