Skip to content

Commit 428e576

Browse files
committed
fix(start.sh): find .env in devstack repo dir, not just workspace root
start.sh only checked ${WORKSPACE_DIR}/.env (= /home/lpb/workspace/.env), but the .env lives in the devstack repo at /home/lpb/workspace/devstack/.env. So .env loading never ran and LPB_ env vars (e.g. LPB_EXA_API_KEY) were never loaded/stripped. Search multiple candidates: workspace root, devstack repo dir, and cwd.
1 parent 0e7950a commit 428e576

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

support/start.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,23 @@ debug "MAX_TOKENS_CONTEXT_RATIO=$MAX_TOKENS_CONTEXT_RATIO"
131131

132132
# ─── 2. LOAD .ENV FROM PROJECT WORKSPACE ─────────────────────────────────────
133133
# Variables from the project's .env file (LPB_* prefix only) override defaults.
134+
# Search multiple candidate locations so the .env is found whether the project
135+
# is mounted at the workspace root OR as a project subdir (e.g. devstack repo
136+
# mounted at ${WORKSPACE_DIR}/devstack), and regardless of the start.sh cwd.
134137

135138
ENV_FILE=""
136-
if [[ -f "${WORKSPACE_DIR}/.env" ]]; then
137-
ENV_FILE="${WORKSPACE_DIR}/.env"
138-
debug "Found .env at ${ENV_FILE}"
139-
fi
139+
_candidates=(
140+
"${WORKSPACE_DIR}/.env"
141+
"${WORKSPACE_DIR}/devstack/.env"
142+
"$(pwd)/.env"
143+
)
144+
for _cand in "${_candidates[@]}"; do
145+
if [[ -n "$_cand" && -f "$_cand" ]]; then
146+
ENV_FILE="$_cand"
147+
debug "Found .env at ${ENV_FILE}"
148+
break
149+
fi
150+
done
140151

141152
if [[ -n "$ENV_FILE" ]]; then
142153
info "Loading environment from ${ENV_FILE}"

0 commit comments

Comments
 (0)