1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2024-12-26 12:15:26 +00:00

Make it clearer what the tar code does

This commit is contained in:
Asher 2019-07-31 15:29:11 -05:00
parent 12af311ce7
commit 5944b842de
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
2 changed files with 13 additions and 6 deletions

View File

@ -8,7 +8,7 @@ import pkg from "vs/platform/product/node/package";
import product from "vs/platform/product/node/product";
import { MainServer } from "vs/server/src/server";
import "vs/server/src/tar";
import { enableExtensionTars } from "vs/server/src/tar";
import { AuthType, buildAllowedMessage, generateCertificate, generatePassword, localRequire, open, unpackExecutables } from "vs/server/src/util";
const { logger } = localRequire<typeof import("@coder/logger/out/index")>("@coder/logger/out/index");
@ -96,6 +96,8 @@ const main = async (): Promise<void | void[]> => {
return buildVersionMessage(version, product.commit).split("\n").map((line) => logger.info(line));
}
enableExtensionTars();
const shouldSpawnCliProcess = (): boolean => {
return !!args["install-source"]
|| !!args["list-extensions"]

View File

@ -153,8 +153,13 @@ const extractTar = async (tarPath: string, targetPath: string, options: IExtract
});
};
// Override original functionality so we can use tar instead of zip.
const target = vszip as typeof vszip;
target.zip = tar;
target.extract = extract;
target.buffer = buffer;
/**
* Override original functionality so we can use extensions that are in a tar in
* addition to zips.
*/
export const enableExtensionTars = (): void => {
const target = vszip as typeof vszip;
target.zip = tar;
target.extract = extract;
target.buffer = buffer;
};