feat: windows support

This commit is contained in:
zhom
2026-02-15 11:48:59 +04:00
parent dd5afac951
commit 63453331ff
46 changed files with 2445 additions and 328 deletions
+26
View File
@@ -1,6 +1,32 @@
#!/bin/bash
set -e
# Ensure cargo/rustc are on PATH (pnpm's bash on Windows may not inherit it)
if ! command -v cargo &>/dev/null; then
# Try standard cargo locations
for cargo_dir in \
"$HOME/.cargo/bin" \
"/c/Users/$USER/.cargo/bin" \
"/mnt/c/Users/$USER/.cargo/bin"; do
if [[ -d "$cargo_dir" ]] && [[ -e "$cargo_dir/cargo" || -e "$cargo_dir/cargo.exe" ]]; then
export PATH="$cargo_dir:$PATH"
break
fi
done
# Try USERPROFILE (Windows env var with backslashes)
if ! command -v cargo &>/dev/null && [[ -n "$USERPROFILE" ]]; then
CARGO_DIR="$(cd "$USERPROFILE/.cargo/bin" 2>/dev/null && pwd)"
if [[ -n "$CARGO_DIR" ]]; then
export PATH="$CARGO_DIR:$PATH"
fi
fi
if ! command -v cargo &>/dev/null; then
echo "Error: cargo not found. Please ensure Rust is installed and cargo is on your PATH."
echo " Install Rust: https://rustup.rs"
exit 1
fi
fi
# Get the target triple from environment or use default
TARGET="${TARGET:-$(rustc -vV 2>/dev/null | sed -n 's|host: ||p' || echo "unknown")}"
MANIFEST_DIR="$(dirname "$0")"