buninu 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.6 - 2026-09-14
4
+
5
+ ### Fixed
6
+
7
+ - Experimental macOS support
8
+ * Fall back to `$0` when `/proc` is unavailable
9
+ * Rename the shell wrapper's `status` variable to `_buninu_status`; `status`
10
+ is read-only in zsh, so the web terminal died the moment it connected on a
11
+ default macOS shell
12
+ * Thanks @hcyuser for the contribution! (#1, #2)
13
+
3
14
  ## 0.4.5 - 2026-09-10
4
15
 
5
16
  0.4.4 is intentionally skipped 不吉利
package/README.md CHANGED
@@ -33,8 +33,9 @@ Buninu requires [Bun](https://bun.com). On Android, install Bun in Termux:
33
33
  npm install -g bun
34
34
  ```
35
35
 
36
- On Linux and Windows, follow the
36
+ - On Linux, Windows, and macOS, follow the
37
37
  [official Bun installation guide](https://bun.com/docs/installation).
38
+ * macOS support is currently experimental
38
39
 
39
40
  ## Start
40
41
 
package/bin/init.js CHANGED
@@ -557,10 +557,10 @@ function shellCommandArguments(shell, command, exitAfterCmd) {
557
557
  }
558
558
 
559
559
  const wrapped =
560
- `buninu_command=$1; shift; ( eval "$buninu_command" ); status=$?; ` +
561
- `if [ "$status" -ne 0 ]; then ` +
562
- `echo "buninu: startup command failed with exit $status" >&2; ` +
563
- (exitAfterCmd ? `fi; exit "$status"` : `fi; exec "$0"`);
560
+ `buninu_command=$1; shift; ( eval "$buninu_command" ); _buninu_status=$?; ` +
561
+ `if [ "$_buninu_status" -ne 0 ]; then ` +
562
+ `echo "buninu: startup command failed with exit $_buninu_status" >&2; ` +
563
+ (exitAfterCmd ? `fi; exit "$_buninu_status"` : `fi; exec "$0"`);
564
564
  // Pass both the shell and startup command as argv instead of interpolating
565
565
  // them into the wrapper. This keeps the wrapper single-line and avoids LF
566
566
  // (Ctrl+J) characters in its process-list representation.
package/bin/multicall.sh CHANGED
@@ -1,10 +1,12 @@
1
1
  #!/bin/sh
2
2
 
3
- args=$(tr '\0' '\n' < /proc/$$/cmdline)
4
-
5
- caller=$(echo "$args" | head -n 1)
6
-
7
- callerb=$(basename "$caller")
3
+ if [ -f /proc/$$/cmdline ] ; then
4
+ args=$(tr '\0' '\n' < /proc/$$/cmdline)
5
+ caller=$(echo "$args" | head -n 1)
6
+ callerb=$(basename "$caller")
7
+ else
8
+ callerb=$(basename "$0")
9
+ fi
8
10
 
9
11
  if [ "$callerb" = sh ] ; then
10
12
  callerb=$(basename "$0")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buninu",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Buninu is a portable, self-bootstrapping Unix-like userspace built on Bun that runs across operating systems",
5
5
  "type": "module",
6
6
  "main": "./bin/init.js",