@@ -107,16 +107,7 @@ export default class LuisBuild extends Command {
107107 let multiRecognizers = new Map < string , any > ( )
108108 let settings = new Map < string , any > ( )
109109
110- if ( flags . stdin && flags . stdin !== '' ) {
111- // load lu content from stdin and create default recognizer, multiRecognier and settings
112- if ( log ) this . log ( 'Load lu content from stdin\n' )
113- const content = new Content ( flags . stdin , new LUOptions ( 'stdin' , true , defaultCulture , path . join ( process . cwd ( ) , 'stdin' ) ) )
114- luContents . push ( content )
115- multiRecognizers . set ( 'stdin' , new MultiLanguageRecognizer ( path . join ( process . cwd ( ) , 'stdin.lu.dialog' ) , { } ) )
116- settings . set ( 'stdin' , new Settings ( path . join ( process . cwd ( ) , `luis.settings.${ suffix } .${ region } .json` ) , { } ) )
117- const recognizer = Recognizer . load ( content . path , content . name , path . join ( process . cwd ( ) , `${ content . name } .dialog` ) , settings . get ( 'stdin' ) , { } )
118- recognizers . set ( content . name , recognizer )
119- } else {
110+ if ( ( inVal && inVal !== '' ) || files . length > 0 ) {
120111 if ( log ) this . log ( 'Loading files...\n' )
121112
122113 // get lu files from in.
@@ -135,6 +126,15 @@ export default class LuisBuild extends Command {
135126 recognizers = loadedResources . recognizers
136127 multiRecognizers = loadedResources . multiRecognizers
137128 settings = loadedResources . settings
129+ } else {
130+ // load lu content from stdin and create default recognizer, multiRecognier and settings
131+ if ( log ) this . log ( 'Load lu content from stdin\n' )
132+ const content = new Content ( flags . stdin , new LUOptions ( 'stdin' , true , defaultCulture , path . join ( process . cwd ( ) , 'stdin' ) ) )
133+ luContents . push ( content )
134+ multiRecognizers . set ( 'stdin' , new MultiLanguageRecognizer ( path . join ( process . cwd ( ) , 'stdin.lu.dialog' ) , { } ) )
135+ settings . set ( 'stdin' , new Settings ( path . join ( process . cwd ( ) , `luis.settings.${ suffix } .${ region } .json` ) , { } ) )
136+ const recognizer = Recognizer . load ( content . path , content . name , path . join ( process . cwd ( ) , `${ content . name } .dialog` ) , settings . get ( 'stdin' ) , { } )
137+ recognizers . set ( content . name , recognizer )
138138 }
139139
140140 // update or create and then train and publish luis applications based on loaded resources
0 commit comments