Skip to content

Commit 5944b84

Browse files
committed
Make it clearer what the tar code does
1 parent 12af311 commit 5944b84

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/cli.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import pkg from "vs/platform/product/node/package";
88
import product from "vs/platform/product/node/product";
99

1010
import { MainServer } from "vs/server/src/server";
11-
import "vs/server/src/tar";
11+
import { enableExtensionTars } from "vs/server/src/tar";
1212
import { AuthType, buildAllowedMessage, generateCertificate, generatePassword, localRequire, open, unpackExecutables } from "vs/server/src/util";
1313

1414
const { logger } = localRequire<typeof import("@coder/logger/out/index")>("@coder/logger/out/index");
@@ -96,6 +96,8 @@ const main = async (): Promise<void | void[]> => {
9696
return buildVersionMessage(version, product.commit).split("\n").map((line) => logger.info(line));
9797
}
9898

99+
enableExtensionTars();
100+
99101
const shouldSpawnCliProcess = (): boolean => {
100102
return !!args["install-source"]
101103
|| !!args["list-extensions"]

src/tar.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,13 @@ const extractTar = async (tarPath: string, targetPath: string, options: IExtract
153153
});
154154
};
155155

156-
// Override original functionality so we can use tar instead of zip.
157-
const target = vszip as typeof vszip;
158-
target.zip = tar;
159-
target.extract = extract;
160-
target.buffer = buffer;
156+
/**
157+
* Override original functionality so we can use extensions that are in a tar in
158+
* addition to zips.
159+
*/
160+
export const enableExtensionTars = (): void => {
161+
const target = vszip as typeof vszip;
162+
target.zip = tar;
163+
target.extract = extract;
164+
target.buffer = buffer;
165+
};

0 commit comments

Comments
 (0)