diff --git a/z b/z index 90f78563fd..7da7ec8905 100755 --- a/z +++ b/z @@ -1,9 +1,20 @@ -#!/bin/sh +#!/usr/bin/env bash # Copyright(c) The Maintainers of Nanvix. # Licensed under the MIT License. -# OS dispatcher – delegates to platform-specific bootstrap wrapper. -case "$(uname -s 2>/dev/null)" in - MINGW* | MSYS* | CYGWIN* | Windows_NT) exec pwsh -NoLogo -File "$(dirname "$0")/z.ps1" "$@" ;; - *) exec "$(dirname "$0")/z.sh" "$@" ;; +# Unified entry point: delegates to z.sh (Linux/macOS) or z.ps1 (Windows). +# Requires nanvix-zutil to be installed (pip install nanvix-zutil). + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +case "$(uname -s)" in + CYGWIN* | MINGW* | MSYS*) + exec powershell.exe -NoProfile -ExecutionPolicy Bypass \ + -File "$SCRIPT_DIR/z.ps1" "$@" + ;; + *) + exec "$SCRIPT_DIR/z.sh" "$@" + ;; esac