From 5f575fcdd60a032f0265e3f9bb67b3708092cfbf Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 31 Jul 2026 15:14:39 -0700 Subject: [PATCH] fix(dev): use portable Bash shebangs (#2536) Resolve Bash through PATH so repository development entrypoints run on NixOS and other systems without /bin/bash. --- docs/coding-standards.md | 4 ++++ packages/desktop/scripts/dev.sh | 2 +- scripts/dev-app.sh | 2 +- scripts/dev-daemon.sh | 2 +- scripts/dev-home.sh | 2 +- scripts/dev.sh | 2 +- scripts/paseo-ios-simulator-service.sh | 2 +- 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/coding-standards.md b/docs/coding-standards.md index 31fb96bc48..ec77d103b8 100644 --- a/docs/coding-standards.md +++ b/docs/coding-standards.md @@ -14,6 +14,10 @@ For testing rules, see [testing.md](testing.md). - **`interface`** over `type` when both work. - **No `index.ts` barrel files** that only re-export — they create indirection and circular-dep risk. Import from the source. +## Shell scripts + +- Bash scripts always use `#!/usr/bin/env bash`. Never hard-code `/bin/bash` or `/usr/bin/bash`; those paths are not portable to environments such as NixOS. + ## Comments and noise - Delete any comment where removing it loses zero information. Comments explain _why_, not _what_. diff --git a/packages/desktop/scripts/dev.sh b/packages/desktop/scripts/dev.sh index 01f69236c7..bcf233bf48 100755 --- a/packages/desktop/scripts/dev.sh +++ b/packages/desktop/scripts/dev.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" diff --git a/scripts/dev-app.sh b/scripts/dev-app.sh index 1f4babf5a4..be9857af65 100755 --- a/scripts/dev-app.sh +++ b/scripts/dev-app.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" diff --git a/scripts/dev-daemon.sh b/scripts/dev-daemon.sh index b02a16ca1b..dda30f7a4b 100755 --- a/scripts/dev-daemon.sh +++ b/scripts/dev-daemon.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" diff --git a/scripts/dev-home.sh b/scripts/dev-home.sh index 98e5a00c6e..a7cea3e051 100755 --- a/scripts/dev-home.sh +++ b/scripts/dev-home.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash default_dev_paseo_root() { git rev-parse --show-toplevel 2>/dev/null || pwd diff --git a/scripts/dev.sh b/scripts/dev.sh index f589a262cd..9e3eb1aea7 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e exec npm run dev:server diff --git a/scripts/paseo-ios-simulator-service.sh b/scripts/paseo-ios-simulator-service.sh index 517ba2c07c..b908c1de73 100755 --- a/scripts/paseo-ios-simulator-service.sh +++ b/scripts/paseo-ios-simulator-service.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"