diff options
| author | Nate Sesti <33237525+sestinj@users.noreply.github.com> | 2023-08-07 15:09:15 -0700 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-07 15:09:15 -0700 | 
| commit | 863b483259ae404d1071bfd1d640e9fbd94c64eb (patch) | |
| tree | ec816a427171ad7c02adc8bee6e6da93487dfc8a /extension/src/activation | |
| parent | e8f06f81a00c05b2d2c93d614666b2298a1273a5 (diff) | |
| parent | 0d1963628c7a5f998aeaf1cf63d8abab2e8923ea (diff) | |
| download | sncontinue-863b483259ae404d1071bfd1d640e9fbd94c64eb.tar.gz sncontinue-863b483259ae404d1071bfd1d640e9fbd94c64eb.tar.bz2 sncontinue-863b483259ae404d1071bfd1d640e9fbd94c64eb.zip | |
Merge pull request #352 from bra1nDump/setup-experience
Improved 2 click setup experience for new devs
Diffstat (limited to 'extension/src/activation')
| -rw-r--r-- | extension/src/activation/environmentSetup.ts | 23 | 
1 files changed, 10 insertions, 13 deletions
| diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index 3c8220c0..81d58afe 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -1,7 +1,7 @@  import { getExtensionUri } from "../util/vscode"; -const util = require("util"); -const exec = util.promisify(require("child_process").exec); -const { spawn } = require("child_process"); +import { promisify } from "util"; +import { exec as execCb } from "child_process"; +import { spawn } from "child_process";  import * as path from "path";  import * as fs from "fs";  import { getContinueServerUrl } from "../bridge"; @@ -10,11 +10,13 @@ import * as vscode from "vscode";  import * as os from "os";  import fkill from "fkill";  import { finished } from "stream/promises"; -const request = require("request"); +import request = require("request"); + +const exec = promisify(execCb);  async function runCommand(cmd: string): Promise<[string, string | undefined]> { -  var stdout: any = ""; -  var stderr: any = ""; +  var stdout = ""; +  var stderr = "";    try {      var { stdout, stderr } = await exec(cmd, {        shell: process.platform === "win32" ? "powershell.exe" : undefined, @@ -23,14 +25,9 @@ async function runCommand(cmd: string): Promise<[string, string | undefined]> {      stderr = e.stderr;      stdout = e.stdout;    } -  if (stderr === "") { -    stderr = undefined; -  } -  if (typeof stdout === "undefined") { -    stdout = ""; -  } -  return [stdout, stderr]; +  const stderrOrUndefined = stderr === "" ? undefined : stderr; +  return [stdout, stderrOrUndefined];  }  async function checkServerRunning(serverUrl: string): Promise<boolean> { | 
