Skip to content

Handle unset env var checks safely#12

Merged
Phlogistique merged 1 commit into
mainfrom
codex/update-check_env_var-for-safe-expansion
Dec 25, 2025
Merged

Handle unset env var checks safely#12
Phlogistique merged 1 commit into
mainfrom
codex/update-check_env_var-for-safe-expansion

Conversation

@Phlogistique
Copy link
Copy Markdown
Collaborator

Motivation

  • Prevent the script from failing under set -u when checking an unset environment variable name.
  • Ensure check_env_var performs a safe indirect expansion to avoid Bash errors for missing variables.

Description

  • Updated the check_env_var function in update-pr-stack.sh to use a safe expansion: [[ -z "${!1-}" ]] instead of [[ -z "${!1}" ]].
  • This avoids an unbound variable error when evaluating the value of a possibly-undefined environment variable name.

Testing

  • No automated tests were executed as part of this change.
  • The repository contains test scripts under tests/ but they were not run for this patch.

Codex Task

@Phlogistique Phlogistique merged commit b31ace1 into main Dec 25, 2025
@github-actions github-actions Bot deleted the codex/update-check_env_var-for-safe-expansion branch December 25, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant