From 339e1830766560a4762b32dea073940715e364a9 Mon Sep 17 00:00:00 2001 From: Roushan Kumar Singh Date: Tue, 20 Jan 2026 12:19:21 +0530 Subject: [PATCH] fix(jan-cli): preserve working directory in wrapper script --- tools/jan-cli.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/jan-cli.sh b/tools/jan-cli.sh index 2fea61d2..7660b490 100644 --- a/tools/jan-cli.sh +++ b/tools/jan-cli.sh @@ -3,7 +3,8 @@ # Automatically builds and runs jan-cli from cmd/jan-cli/ set -e - +# Save the original working directory +ROOT_DIR="$(pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CLI_DIR="${SCRIPT_DIR}/jan-cli" CLI_BINARY="${CLI_DIR}/jan-cli" @@ -26,8 +27,10 @@ if [ "$needs_build" = true ]; then echo "Building jan-cli..." >&2 cd "${CLI_DIR}" go build -o jan-cli . - cd "${SCRIPT_DIR}" fi +# Change to the original working directory +cd "${ROOT_DIR}" + # Run jan-cli with all arguments exec "${CLI_BINARY}" "$@"