openmux 0.2.2 → 0.2.4
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/bin/openmux +23 -5
- package/package.json +1 -1
package/bin/openmux
CHANGED
|
@@ -130,6 +130,9 @@ download_binary() {
|
|
|
130
130
|
# Make executable
|
|
131
131
|
chmod +x "$BIN_DIR/openmux-bin" 2>/dev/null || true
|
|
132
132
|
|
|
133
|
+
# Create empty bunfig.toml to prevent reading user's project config
|
|
134
|
+
echo "# openmux runtime config (empty - preload already compiled in)" > "$BIN_DIR/bunfig.toml"
|
|
135
|
+
|
|
133
136
|
# Write version file for upgrade detection
|
|
134
137
|
echo "$version" > "$BIN_DIR/.version"
|
|
135
138
|
|
|
@@ -145,13 +148,22 @@ case "$(uname -s)" in
|
|
|
145
148
|
*) echo "Unsupported OS" >&2; exit 1 ;;
|
|
146
149
|
esac
|
|
147
150
|
|
|
151
|
+
# Capture original cwd before any cd operations (for initial shell directory)
|
|
152
|
+
export OPENMUX_ORIGINAL_CWD="${OPENMUX_ORIGINAL_CWD:-$(pwd)}"
|
|
153
|
+
|
|
148
154
|
# Get package version
|
|
149
155
|
PKG_JSON="$(find_package_json)"
|
|
150
156
|
if [[ -z "$PKG_JSON" ]]; then
|
|
151
157
|
# Fallback: if binary exists, just run it
|
|
152
158
|
if [[ -x "$BIN_DIR/openmux-bin" ]]; then
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
# Ensure empty bunfig.toml exists
|
|
160
|
+
if [[ ! -f "$BIN_DIR/bunfig.toml" ]]; then
|
|
161
|
+
echo "# openmux runtime config (empty - preload already compiled in)" > "$BIN_DIR/bunfig.toml"
|
|
162
|
+
fi
|
|
163
|
+
export ZIG_PTY_LIB="${ZIG_PTY_LIB:-$BIN_DIR/libzig_pty.$LIB_EXT}"
|
|
164
|
+
# cd to BIN_DIR to avoid reading user's bunfig.toml
|
|
165
|
+
cd "$BIN_DIR"
|
|
166
|
+
exec "./openmux-bin" "$@"
|
|
155
167
|
fi
|
|
156
168
|
echo "Error: Could not find openmux package" >&2
|
|
157
169
|
exit 1
|
|
@@ -173,6 +185,12 @@ if [[ ! -x "$BIN_DIR/openmux-bin" ]] || [[ "$INSTALLED_VERSION" != "$VERSION" ]]
|
|
|
173
185
|
download_binary "$VERSION" || exit 1
|
|
174
186
|
fi
|
|
175
187
|
|
|
176
|
-
#
|
|
177
|
-
|
|
178
|
-
|
|
188
|
+
# Ensure empty bunfig.toml exists (for older releases that didn't include it)
|
|
189
|
+
if [[ ! -f "$BIN_DIR/bunfig.toml" ]]; then
|
|
190
|
+
echo "# openmux runtime config (empty - preload already compiled in)" > "$BIN_DIR/bunfig.toml"
|
|
191
|
+
fi
|
|
192
|
+
|
|
193
|
+
# Set library path, cd to BIN_DIR to avoid user's bunfig.toml, and execute
|
|
194
|
+
export ZIG_PTY_LIB="${ZIG_PTY_LIB:-$BIN_DIR/libzig_pty.$LIB_EXT}"
|
|
195
|
+
cd "$BIN_DIR"
|
|
196
|
+
exec "./openmux-bin" "$@"
|