Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/util.ts')
-rw-r--r--editors/code/src/util.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts
index d93b9caeb1..922fbcbcf3 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;