fix: an issue where the @ command could not be used correctly in other workspaces and ensured cross-platform compatibility.

This commit is contained in:
haoshuoyang 2026-04-04 16:11:03 +08:00
parent 55a210a2f7
commit c81decb9b9
2 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,9 @@
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
#Get your current working directory and export it as an environment variable.
export CALLER_DIR="$(pwd -W 2>/dev/null || pwd)"
cd "$ROOT_DIR"
# Force recovery CLI (simple readline REPL, no Ink TUI)

View File

@ -15,3 +15,7 @@ Object.assign(globalThis, {
ISSUES_EXPLAINER: '',
},
});
// Switch to the current workspace
if (process.env.CALLER_DIR) {
process.chdir(process.env.CALLER_DIR);
}