Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit a67721b

Browse files
axelsrzmunozemilio
authored andcommitted
Fixed piping data (#294)
1 parent 0e7b1f3 commit a67721b

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/lu/src/commands/luis/generate/cs.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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))

packages/lu/src/commands/luis/generate/ts.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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))
Binary file not shown.

0 commit comments

Comments
 (0)