Skip to content

Commit

Permalink
Fixed piping data
Browse files Browse the repository at this point in the history
  • Loading branch information
axelsrz committed Oct 29, 2019
1 parent 0e7b1f3 commit 74f57fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/lu/src/commands/luis/generate/cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export default class LuisGenerateCs extends Command {
let space = 'Luis'
let stdInput = await this.readStdin()

const pathPrefix = path.isAbsolute(flags.in) ? '' : process.cwd()
if (!flags.in && !stdInput) {
throw new CLIError('Missing input. Please use stdin or pass a file location with --in flag')
}

const pathPrefix = flags.in && path.isAbsolute(flags.in) ? '' : process.cwd()
let app: any
try {
app = stdInput ? JSON.parse(stdInput as string) : await fs.readJSON(path.join(pathPrefix, flags.in))
Expand Down
6 changes: 5 additions & 1 deletion packages/lu/src/commands/luis/generate/ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export default class LuisGenerateTs extends Command {
const {flags} = this.parse(LuisGenerateTs)
let stdInput = await this.readStdin()

const pathPrefix = path.isAbsolute(flags.in) ? '' : process.cwd()
if (!flags.in && !stdInput) {
throw new CLIError('Missing input. Please use stdin or pass a file location with --in flag')
}

const pathPrefix = flags.in && path.isAbsolute(flags.in) ? '' : process.cwd()
let app: any
try {
app = stdInput ? JSON.parse(stdInput as string) : await fs.readJSON(path.join(pathPrefix, flags.in))
Expand Down
Binary file not shown.

0 comments on commit 74f57fd

Please sign in to comment.