Skip to content

Commit 4ad6833

Browse files
authored
fix: trust mise config in mux workspace hooks (#26)
1 parent 14609b9 commit 4ad6833

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

.mux/init

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ if [ -z "$_mux_mise_bin" ]; then
2222
fi
2323

2424
echo "[mux:init] using mise at $_mux_mise_bin"
25+
26+
_mux_mise_config="$PWD/mise.toml"
27+
if [ -f "$_mux_mise_config" ]; then
28+
# Worktree workspaces live at unique paths, so mise treats each workspace copy
29+
# as a newly untrusted config until it is explicitly trusted.
30+
"$_mux_mise_bin" trust -y "$_mux_mise_config" >/dev/null 2>&1 || true
31+
fi
32+
2533
"$_mux_mise_bin" install
2634
"$_mux_mise_bin" run bootstrap
2735

2836
unset _mux_mise_bin
37+
unset _mux_mise_config

.mux/tool_env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ elif [ -x "/usr/local/bin/mise" ]; then
1414
fi
1515

1616
if [ -n "$_mux_mise_bin" ]; then
17+
_mux_mise_config="$PWD/mise.toml"
18+
if [ -f "$_mux_mise_config" ]; then
19+
# New worktree paths start untrusted, and bash commands may run before the
20+
# async init hook finishes trusting the copied mise.toml.
21+
"$_mux_mise_bin" trust -y "$_mux_mise_config" >/dev/null 2>&1 || true
22+
fi
23+
1724
eval "$("$_mux_mise_bin" activate bash --shims 2>/dev/null)" || true
1825
fi
1926

2027
unset _mux_mise_bin
28+
unset _mux_mise_config

0 commit comments

Comments
 (0)