Skip to content

Commit a6afb7f

Browse files
konardclaude
andcommitted
fix(entrypoint): use default values for GEMINI_AUTH_LABEL to prevent unbound variable error
The entrypoint script uses `set -u` which causes errors when variables are not set. Using `${GEMINI_AUTH_LABEL:-}` and `${GEMINI_AUTH_LABEL:-default}` ensures the script works correctly even when the variable is not defined. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2ee010a commit a6afb7f

File tree

1 file changed

+3
-3
lines changed
  • packages/lib/src/core/templates-entrypoint

1 file changed

+3
-3
lines changed

packages/lib/src/core/templates-entrypoint/gemini.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const geminiAuthRootContainerPath = (sshUser: string): string => `/home/${sshUse
1515

1616
const geminiAuthConfigTemplate = String
1717
.raw`# Gemini CLI: expose GEMINI_API_KEY for SSH sessions (API key stored under ~/.docker-git/.orch/auth/gemini)
18-
GEMINI_LABEL_RAW="$GEMINI_AUTH_LABEL"
18+
GEMINI_LABEL_RAW="${"$"}{GEMINI_AUTH_LABEL:-}"
1919
if [[ -z "$GEMINI_LABEL_RAW" ]]; then
2020
GEMINI_LABEL_RAW="default"
2121
fi
@@ -134,7 +134,7 @@ docker_git_ensure_gemini_cli`
134134

135135
const renderGeminiProfileSetup = (): string =>
136136
String.raw`GEMINI_PROFILE="/etc/profile.d/gemini-config.sh"
137-
printf "export GEMINI_AUTH_LABEL=%q\n" "$GEMINI_AUTH_LABEL" > "$GEMINI_PROFILE"
137+
printf "export GEMINI_AUTH_LABEL=%q\n" "${"$"}{GEMINI_AUTH_LABEL:-default}" > "$GEMINI_PROFILE"
138138
cat <<'EOF' >> "$GEMINI_PROFILE"
139139
GEMINI_API_KEY_FILE="${"$"}{GEMINI_AUTH_DIR:-$HOME/.gemini}/.api-key"
140140
GEMINI_ENV_FILE="${"$"}{GEMINI_AUTH_DIR:-$HOME/.gemini}/.env"
@@ -149,7 +149,7 @@ fi
149149
EOF
150150
chmod 0644 "$GEMINI_PROFILE" || true
151151
152-
docker_git_upsert_ssh_env "GEMINI_AUTH_LABEL" "$GEMINI_AUTH_LABEL"
152+
docker_git_upsert_ssh_env "GEMINI_AUTH_LABEL" "${"$"}{GEMINI_AUTH_LABEL:-default}"
153153
docker_git_upsert_ssh_env "GEMINI_API_KEY" "${"$"}{GEMINI_API_KEY:-}"`
154154

155155
export const renderEntrypointGeminiConfig = (config: TemplateConfig): string =>

0 commit comments

Comments
 (0)