aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/installation
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/installation')
-rw-r--r--editors/code/src/installation/download_artifact.ts9
-rw-r--r--editors/code/src/installation/download_file.ts3
-rw-r--r--editors/code/src/installation/server.ts3
3 files changed, 6 insertions, 9 deletions
diff --git a/editors/code/src/installation/download_artifact.ts b/editors/code/src/installation/download_artifact.ts
index 8ed99bf0a..97e4d67c2 100644
--- a/editors/code/src/installation/download_artifact.ts
+++ b/editors/code/src/installation/download_artifact.ts
@@ -1,10 +1,10 @@
1import * as vscode from "vscode"; 1import * as vscode from "vscode";
2import * as path from "path"; 2import * as path from "path";
3import { promises as fs } from "fs"; 3import { promises as fs } from "fs";
4import { strict as assert } from "assert";
5 4
6import { ArtifactReleaseInfo } from "./interfaces"; 5import { ArtifactReleaseInfo } from "./interfaces";
7import { downloadFile } from "./download_file"; 6import { downloadFile } from "./download_file";
7import { assert } from "../util";
8 8
9/** 9/**
10 * Downloads artifact from given `downloadUrl`. 10 * Downloads artifact from given `downloadUrl`.
@@ -19,11 +19,10 @@ export async function downloadArtifact(
19 installationDir: string, 19 installationDir: string,
20 displayName: string, 20 displayName: string,
21) { 21) {
22 await fs.mkdir(installationDir).catch(err => assert.strictEqual( 22 await fs.mkdir(installationDir).catch(err => assert(
23 err?.code, 23 err?.code === "EEXIST",
24 "EEXIST",
25 `Couldn't create directory "${installationDir}" to download ` + 24 `Couldn't create directory "${installationDir}" to download ` +
26 `${artifactFileName} artifact: ${err.message}` 25 `${artifactFileName} artifact: ${err?.message}`
27 )); 26 ));
28 27
29 const installationPath = path.join(installationDir, artifactFileName); 28 const installationPath = path.join(installationDir, artifactFileName);
diff --git a/editors/code/src/installation/download_file.ts b/editors/code/src/installation/download_file.ts
index 319cb995c..ee8949d61 100644
--- a/editors/code/src/installation/download_file.ts
+++ b/editors/code/src/installation/download_file.ts
@@ -2,8 +2,7 @@ import fetch from "node-fetch";
2import * as fs from "fs"; 2import * as fs from "fs";
3import * as stream from "stream"; 3import * as stream from "stream";
4import * as util from "util"; 4import * as util from "util";
5import { strict as assert } from "assert"; 5import { log, assert } from "../util";
6import { log } from "../util";
7 6
8const pipeline = util.promisify(stream.pipeline); 7const pipeline = util.promisify(stream.pipeline);
9 8
diff --git a/editors/code/src/installation/server.ts b/editors/code/src/installation/server.ts
index cb5e56844..6a6cf4f8c 100644
--- a/editors/code/src/installation/server.ts
+++ b/editors/code/src/installation/server.ts
@@ -1,13 +1,12 @@
1import * as vscode from "vscode"; 1import * as vscode from "vscode";
2import * as path from "path"; 2import * as path from "path";
3import { strict as assert } from "assert";
4import { promises as dns } from "dns"; 3import { promises as dns } from "dns";
5import { spawnSync } from "child_process"; 4import { spawnSync } from "child_process";
6 5
7import { BinarySource } from "./interfaces"; 6import { BinarySource } from "./interfaces";
8import { fetchArtifactReleaseInfo } from "./fetch_artifact_release_info"; 7import { fetchArtifactReleaseInfo } from "./fetch_artifact_release_info";
9import { downloadArtifact } from "./download_artifact"; 8import { downloadArtifact } from "./download_artifact";
10import { log } from "../util"; 9import { log, assert } from "../util";
11 10
12export async function ensureServerBinary(source: null | BinarySource): Promise<null | string> { 11export async function ensureServerBinary(source: null | BinarySource): Promise<null | string> {
13 if (!source) { 12 if (!source) {