⚡️ allow dir mode binary

This commit is contained in:
Nate Sesti 2023-11-05 15:38:04 -08:00
parent 6281cc7981
commit 36d1fb8f6b
3 changed files with 16 additions and 3 deletions

View file

@ -7,7 +7,7 @@ import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--arch", type=str)
parser.add_argument("--dir", type=bool, default=False)
parser.add_argument("--dir", action="store_true")
options = parser.parse_args()
block_cipher = None

View file

@ -76,11 +76,16 @@ function serverVersionPath(): string {
}
function serverBinaryPath(): string {
return path.join(
let binaryPath = path.join(
serverPath(),
"exe",
`continue_server${os.platform() === "win32" ? ".exe" : ""}`
);
// If it's a directory, this is a directory mode pyinstaller binary
if (fs.existsSync(binaryPath) && fs.lstatSync(binaryPath).isDirectory()) {
binaryPath = path.join(binaryPath, "continue_server");
}
return binaryPath;
}
export function getExtensionVersion() {
@ -206,11 +211,15 @@ export async function downloadFromS3(
function includedBinaryPath(): string {
const extensionPath = getExtensionUri().fsPath;
return path.join(
let binaryPath = path.join(
extensionPath,
"exe",
`continue_server${os.platform() === "win32" ? ".exe" : ""}`
);
if (fs.existsSync(binaryPath) && fs.lstatSync(binaryPath).isDirectory()) {
binaryPath = path.join(binaryPath, "continue_server");
}
return binaryPath;
}
function runExecutable(path: string) {

View file

@ -207,6 +207,10 @@ class IdeProtocolClient {
callback: (data: any) => void
) {
const respond = (messageType: string, responseData: any) => {
if (typeof callback === "undefined") {
console.log("callback is undefined");
return;
}
callback({
message_type: messageType,
data: responseData,