diff --git a/Makefile b/Makefile index bf465c89c..53b6a57c0 100644 --- a/Makefile +++ b/Makefile @@ -24,12 +24,14 @@ # Branches reduce reproducibility - builds should fail fast with clear errors # if dependencies are missing, not silently fall back to different behavior. -# Use PATH-resolved bash on Windows to avoid hardcoded /usr/bin/bash which doesn't -# exist in Chocolatey's make environment or on GitHub Actions windows-latest. +# Use PATH-resolved bash for portability across different systems. +# - Windows: /usr/bin/bash doesn't exist in Chocolatey's make environment or GitHub Actions +# - NixOS: /bin/bash doesn't exist, bash is in /nix/store/... +# - Other systems: /usr/bin/env bash resolves from PATH ifeq ($(OS),Windows_NT) SHELL := bash else -SHELL := /bin/bash +SHELL := /usr/bin/env bash endif .SHELLFLAGS := -eu -o pipefail -c diff --git a/docs/init-hooks.md b/docs/init-hooks.md index b5eb46459..eaa14e050 100644 --- a/docs/init-hooks.md +++ b/docs/init-hooks.md @@ -5,7 +5,7 @@ Add a `.mux/init` executable script to your project root to run commands when cr ## Example ```bash -#!/bin/bash +#!/usr/bin/env bash set -e bun install @@ -40,7 +40,7 @@ Init hooks receive the following environment variables: **Note for SSH workspaces:** Since the project is synced to the remote machine, files exist in both locations. The init hook runs in the workspace directory (`$PWD`), so use relative paths to reference project files: ```bash -#!/bin/bash +#!/usr/bin/env bash set -e echo "Runtime: $MUX_RUNTIME" diff --git a/scripts/setup-macos-signing.sh b/scripts/setup-macos-signing.sh index f0f5ee550..377645eda 100755 --- a/scripts/setup-macos-signing.sh +++ b/scripts/setup-macos-signing.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Sets up macOS code signing and notarization from GitHub secrets # Usage: ./scripts/setup-macos-signing.sh # diff --git a/vscode/scripts/create-icon.sh b/vscode/scripts/create-icon.sh index 70ba9e9a1..dd58b80f9 100755 --- a/vscode/scripts/create-icon.sh +++ b/vscode/scripts/create-icon.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Create icon.png from the cmux logo for the VS Code extension set -e