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

Commit bbe3f35

Browse files
committed
Fixing issue with stdin payload
1 parent e05d63d commit bbe3f35

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

packages/qnamaker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"postpack": "rm -f oclif.manifest.json",
7272
"posttest": "tslint -p test -t stylish",
7373
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
74-
"test": "nyc --reporter=html --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
74+
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
7575
"version": "oclif-dev readme && git add README.md"
7676
}
7777
}

packages/qnamaker/src/utils/qnamakerbase.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ export async function processInputs(flags: any, payload: any, configfile: string
1414
ServiceBase.config = flags
1515
await qnaconfig.validateConfig(flags)
1616
const serviceManifest = srvMan.getServiceManifest(payload)
17+
flags.in = stdin ? stdin : flags.in
1718
result.requestBody = await srvMan.validateArguments(serviceManifest, flags)
1819
if (stdin || flags.in) {
19-
result.requestBody = stdin ? stdin : await getFileInput(flags.in)
20+
result.requestBody = stdin ? JSON.parse(stdin) : await getFileInput(flags.in)
2021
}
2122
result.config = config
2223
result.serviceManifest = serviceManifest

packages/qnamaker/utils/servicemanifest.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const fs = require('fs-extra')
2-
const path = require('path')
31
const cc = require('camelcase');
42

53
function getServiceManifest(json) {

0 commit comments

Comments
 (0)