Skip to content

Commit 07a977d

Browse files
committed
fix CLI invocation when root of workspace lacks a package.json file
1 parent 04fdd54 commit 07a977d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/data/report.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ export function activate(context: vscode.ExtensionContext, disposables?: Array<v
164164
({uri, body}) => {
165165
return {
166166
fsPath: uri.fsPath,
167+
uri,
167168
str: Buffer.from(body).toString()
168169
}
169170
}
@@ -201,7 +202,10 @@ export function activate(context: vscode.ExtensionContext, disposables?: Array<v
201202
process.execPath,
202203
[
203204
entryPoint,
204-
'report', 'create', '--json', workspaceFolderURI.fsPath
205+
'report', 'create', '--json', ...files.map(file => {
206+
const joined = vscode.Uri.joinPath(file.uri, '..')
207+
return joined.fsPath
208+
})
205209
],
206210
{
207211
cwd: workspaceFolderURI.fsPath,
@@ -212,7 +216,7 @@ export function activate(context: vscode.ExtensionContext, disposables?: Array<v
212216
}
213217
)
214218
const stdout = text(child.stdout);
215-
const stderr = text(child.stdout);
219+
const stderr = text(child.stderr);
216220
try {
217221
const [exitCode] = await once(child, 'exit');
218222
if (exitCode !== 0) {

0 commit comments

Comments
 (0)