From e4ee28d1c6d78113ef43a44226c4f46eabfcab5e Mon Sep 17 00:00:00 2001 From: Max Novich Date: Wed, 29 Jan 2025 10:28:08 -0800 Subject: [PATCH] add powershell support for just --- Justfile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Justfile b/Justfile index 7caed1de17..fab8b3b558 100644 --- a/Justfile +++ b/Justfile @@ -8,13 +8,19 @@ release: # Build Windows executable release-windows: - @echo "Building Windows executable..." - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp \ - rust:latest \ - sh -c "rustup target add x86_64-pc-windows-gnu && \ - apt-get update && \ - apt-get install -y mingw-w64 && \ - cargo build --release --target x86_64-pc-windows-gnu" + #!/usr/bin/env sh + if [ "$(uname)" = "Darwin" ] || [ "$(uname)" = "Linux" ]; then + echo "Building Windows executable using Docker..." + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp \ + rust:latest \ + sh -c "rustup target add x86_64-pc-windows-gnu && \ + apt-get update && \ + apt-get install -y mingw-w64 && \ + cargo build --release --target x86_64-pc-windows-gnu" + else + echo "Building Windows executable natively..." + powershell.exe -Command "docker run --rm -v ${PWD}:/usr/src/myapp -w /usr/src/myapp rust:latest sh -c 'rustup target add x86_64-pc-windows-gnu && apt-get update && apt-get install -y mingw-w64 && cargo build --release --target x86_64-pc-windows-gnu'" + fi @echo "Windows executable created at ./target/x86_64-pc-windows-gnu/release/goosed.exe" # Copy binary command @@ -58,7 +64,6 @@ make-ui-windows: echo "Windows binary not found."; \ exit 1; \ fi - export MONO_GAC_PREFIX="/opt/homebrew"; \ cd ui/desktop && npm run bundle:windows # Setup langfuse server