From 3a65776a3cdbab855b3f8b2d5b129d57e2aaed61 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Mon, 25 Nov 2024 11:24:18 +0000 Subject: [PATCH] fix(lib): decompression on windows * Decompression on windows failed since the `Start-Process` cmdlet exited immediately after spawning the process. Fixed by including the `-Wait` argument. * We were using `unzip` on all platforms, and it does not exist on Windows. Instead, now we use the `Expand-Archive` cmdlet for decompression on windows. --- toolchainlib/src/compression.luau | 10 +++++++--- toolchainlib/src/utils/exec.luau | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/toolchainlib/src/compression.luau b/toolchainlib/src/compression.luau index 54241da..503cd5c 100644 --- a/toolchainlib/src/compression.luau +++ b/toolchainlib/src/compression.luau @@ -58,9 +58,13 @@ local decompress: { [CompressionFormat]: (compressed: buffer) -> Result, diff --git a/toolchainlib/src/utils/exec.luau b/toolchainlib/src/utils/exec.luau index d4a641d..0300d23 100644 --- a/toolchainlib/src/utils/exec.luau +++ b/toolchainlib/src/utils/exec.luau @@ -120,7 +120,7 @@ function CommandBuilder.intoChildProcess(self: CommandBuilder): ChildProcess for _ = 0, retries do local spawned = process.spawn( if process.os == "windows" - then `(Start-Process {self.program} -Passthru -NoNewWindow -ArgumentList \"{argsList}\").Id` + then `(Start-Process {self.program} -Passthru -Wait -ExecutionPolicy Bypass -NoNewWindow -ArgumentList \"{argsList}\").Id` else `{self.program} {argsList} & echo $!`, {}, {