[PR #1061] [MERGED] fix(install): guard empty prefix_args expansion on macOS Bash 3.2 under set -u #2614

Closed
opened 2026-10-17 21:08:13 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1061
Author: @ArianPashae
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/install-sh-macos-bash32-nounset


📝 Commits (3)

  • 644d55f fix(install): guard empty prefix_args expansion under Bash 3.2 set -u (#1060)
  • 7b28f6e Merge remote-tracking branch 'origin/main' into maintain/pr-1061
  • fce6b9e test(install): cover native Bash macOS installation

📊 Changes

3 files changed (+20 additions, -3 deletions)

View changed files

📝 .github/workflows/ci.yml (+2 -2)
📝 install.sh (+1 -1)
📝 tests/boundary/filesystem/installScript.test.ts (+17 -0)

📄 Description

Fixes #1060

Summary

On macOS (Darwin), install.sh runs under #!/bin/bash (Apple's system GNU Bash 3.2.57) with set -euo pipefail. Because prefix_args=() is only populated on Linux and remains empty on macOS, expanding "${prefix_args[@]}" at line 110 causes Bash 3.2 to abort with:

install.sh: line 110: prefix_args[@]: unbound variable

(Note: --dry-run exits at line 106 before reaching line 110.)

Fix

Use the standard Bash 3.2 set -u-safe expansion ${prefix_args[@]+"${prefix_args[@]}"} when invoking npm install --global.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1061 **Author:** [@ArianPashae](https://github.com/ArianPashae) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/install-sh-macos-bash32-nounset` --- ### 📝 Commits (3) - [`644d55f`](https://github.com/morluto/rea/commit/644d55f22db7d13f0b00bba481eb7723f8c67902) fix(install): guard empty prefix_args expansion under Bash 3.2 set -u (#1060) - [`7b28f6e`](https://github.com/morluto/rea/commit/7b28f6ee6b5fe64e0806b14e89041fcfae6fccd1) Merge remote-tracking branch 'origin/main' into maintain/pr-1061 - [`fce6b9e`](https://github.com/morluto/rea/commit/fce6b9e87498a97ba11eb97ffa0f5b3391ca43d4) test(install): cover native Bash macOS installation ### 📊 Changes **3 files changed** (+20 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+2 -2) 📝 `install.sh` (+1 -1) 📝 `tests/boundary/filesystem/installScript.test.ts` (+17 -0) </details> ### 📄 Description Fixes #1060 ### Summary On macOS (`Darwin`), `install.sh` runs under `#!/bin/bash` (Apple's system GNU Bash 3.2.57) with `set -euo pipefail`. Because `prefix_args=()` is only populated on Linux and remains empty on macOS, expanding `"${prefix_args[@]}"` at line 110 causes Bash 3.2 to abort with: ```text install.sh: line 110: prefix_args[@]: unbound variable ``` (Note: `--dry-run` exits at line 106 before reaching line 110.) ### Fix Use the standard Bash 3.2 `set -u`-safe expansion `${prefix_args[@]+"${prefix_args[@]}"}` when invoking `npm install --global`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:08:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2614
No description provided.