From 94d963d8ef67a111f4cc94de127de0d4c6827ea0 Mon Sep 17 00:00:00 2001 From: nokeo08 Date: Wed, 17 Jun 2026 16:35:04 -0500 Subject: [PATCH] Make scripts/dev-setup.sh POSIX-portable The contributor bootstrap script was bash-only ('#!/usr/bin/env bash', 'set -euo pipefail', '[[ ... == ... ]]') while install.sh and uninstall.sh are POSIX sh. Consistency lines them up: - shebang -> '#!/usr/bin/env sh' - 'set -euo pipefail' -> 'set -eu' (pipefail isn't POSIX; not needed here either, no risky pipelines in this script) - '[[ ... == ... ]]' -> '[ ... = ... ]' Also added a 'bun run test' hint to the post-install workflow note now that there's a test suite to run. --- scripts/dev-setup.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/dev-setup.sh b/scripts/dev-setup.sh index 0531a33..144aff0 100755 --- a/scripts/dev-setup.sh +++ b/scripts/dev-setup.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh # # dev-setup.sh - contributor bootstrap for the `move` repo. # @@ -11,13 +11,17 @@ # # This script is idempotent: re-running it just re-resolves the dependency # tree against the existing `bun.lock`. +# +# POSIX sh; no bashisms. Matches the style of install.sh / uninstall.sh. -# Fail fast on any error, unset variable, or failed pipe stage. -set -euo pipefail +# Fail fast on any error or unset variable. (`pipefail` is bash-only and +# not strictly needed here; this script doesn't pipe in failure-prone +# ways.) +set -eu -# Operate at the repo root regardless of the caller's CWD. This script lives -# under scripts/, so pop up one level to land at the project root before -# running bun install. +# Operate at the repo root regardless of the caller's CWD. This script +# lives under scripts/, so pop up one level to land at the project root +# before running bun install. cd "$(dirname "$0")/.." echo "==> Checking for Bun..." @@ -36,13 +40,14 @@ bun install echo echo "Done. Dev workflow:" echo " - 'bun run start' to run from the source tree." +echo " - 'bun run test' to run the test suite." echo " - 'bun link' to install a global 'move' command pointed at this checkout." echo "End-user installer is install.sh (curl-pipeable from Gitea)." # macOS gates synthetic mouse events behind the Accessibility permission. # Without this hint, the first run silently fails to move the cursor and # the user has no obvious next step. -if [[ "$(uname)" == "Darwin" ]]; then +if [ "$(uname)" = "Darwin" ]; then echo "Note: macOS will prompt for Accessibility permission on first mouse move." echo " Grant it under System Settings > Privacy & Security > Accessibility." fi