File tree Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 6969 },
7070 "dependencies" : {
7171 "async-file" : " 2.0.2" ,
72+ "child-process-promise" : " ^2.2.1" ,
7273 "fs-extra" : " 5.0.0" ,
7374 "http-proxy-agent" : " 2.1.0" ,
7475 "https-proxy-agent" : " 2.2.1" ,
Original file line number Diff line number Diff line change 44 *--------------------------------------------------------------------------------------------*/
55
66import * as vscode from "vscode" ;
7- import cp = require ( "child_process" ) ;
7+ import { getDotnetInfo } from "./getdotnetInfo" ;
88
99const extensionId = 'ms-vscode.csharp' ;
1010const extension = vscode . extensions . getExtension ( extensionId ) ;
@@ -18,7 +18,7 @@ let extensions = vscode.extensions.all
1818extensions . sort ( sortExtensions ) ;
1919
2020export default async function generateBugReport ( ) {
21- const dotnetInfo = cp . execSync ( "dotnet --info" ) ;
21+ const dotnetInfo = await getDotnetInfo ( ) ;
2222
2323 const body = encodeURIComponent ( `## Issue Description ##
2424## Steps to Reproduce ##
Original file line number Diff line number Diff line change 1+ /*---------------------------------------------------------------------------------------------
2+ * Copyright (c) Microsoft Corporation. All rights reserved.
3+ * Licensed under the MIT License. See License.txt in the project root for license information.
4+ *--------------------------------------------------------------------------------------------*/
5+ import * as cp from "child-process-promise" ;
6+
7+ export async function getDotnetInfo ( ) : Promise < string > {
8+ try {
9+ let result = await cp . exec ( "dotnet --info" ) ;
10+ return result . stdout ;
11+ }
12+ catch {
13+ return "Dotnet info could not be obtained" ;
14+ }
15+ }
Original file line number Diff line number Diff line change 1+ declare module 'child-process-promise' {
2+
3+ import { ChildProcess , ExecOptions } from "child_process" ;
4+ export function exec ( command : string , options ?: ExecOptions ) : Promise < Result > ;
5+
6+ export interface Result {
7+ childProcess : ChildProcess ;
8+ stdout : string ;
9+ stdErr : string ;
10+ }
11+ }
You can’t perform that action at this time.
0 commit comments