diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2023-03-20 08:31:01 +0200 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2023-03-20 08:31:01 +0200 |
| commit | dbf04a5ee29101afbd1db665369bb1d21224efb5 (patch) | |
| tree | 7e3c862b526a3f7305549fb2a2e34dcbb38bb3a9 /editors/code/src/util.ts | |
| parent | 544b4cfe4de2119807eb4d874c2cf095c5587bc4 (diff) | |
| download | rust-dbf04a5ee29101afbd1db665369bb1d21224efb5.tar.gz rust-dbf04a5ee29101afbd1db665369bb1d21224efb5.zip | |
:arrow_up: rust-analyzer
Diffstat (limited to 'editors/code/src/util.ts')
| -rw-r--r-- | editors/code/src/util.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts index d93b9caeb16..922fbcbcf35 100644 --- a/editors/code/src/util.ts +++ b/editors/code/src/util.ts @@ -150,9 +150,11 @@ export function memoizeAsync<Ret, TThis, Param extends string>( /** Awaitable wrapper around `child_process.exec` */ export function execute(command: string, options: ExecOptions): Promise<string> { + log.info(`running command: ${command}`); return new Promise((resolve, reject) => { exec(command, options, (err, stdout, stderr) => { if (err) { + log.error(err); reject(err); return; } @@ -167,6 +169,21 @@ export function execute(command: string, options: ExecOptions): Promise<string> }); } +export function executeDiscoverProject(command: string, options: ExecOptions): Promise<string> { + log.info(`running command: ${command}`); + return new Promise((resolve, reject) => { + exec(command, options, (err, stdout, _) => { + if (err) { + log.error(err); + reject(err); + return; + } + + resolve(stdout.trimEnd()); + }); + }); +} + export class LazyOutputChannel implements vscode.OutputChannel { constructor(name: string) { this.name = name; |
