Skip to content

fix: correct syntax errors and typos in shell scripts#982

Merged
osterman merged 1 commit intomainfrom
parsing-and-syntax-error-fixes
Mar 23, 2026
Merged

fix: correct syntax errors and typos in shell scripts#982
osterman merged 1 commit intomainfrom
parsing-and-syntax-error-fixes

Conversation

@RoseSecurity
Copy link
Copy Markdown
Member

why

  • This includes several minor fixes and improvements to shell scripts and the Debian Dockerfile to address typos and improve code correctness. The changes focus on correcting environment variable usage, fixing typos in argument names, and improving conditional checks.

what

  • Fixed a typo in the ARG definition by renaming DEBAIN_DATECODE to DEBIAN_DATECODE in os/debian/Dockerfile.debian.
  • Updated the FROM line to use the corrected DEBIAN_DATECODE argument.
  • Corrected the conditional check for bold formatting in _geodesic_tput_cache_init by fixing the bracket placement in rootfs/etc/profile.d/_10-colors.sh.
  • Improved path matching logic in file_on_host to correctly compare paths in rootfs/etc/profile.d/_50-workspace.sh.
  • Fixed quoting and conditional checks for KUBECONFIG in the Helm initialization script in rootfs/etc/profile.d/helm.sh.
  • Corrected the conditional check for GEODESIC_TF_PROMPT_ENABLED in geodesic_prompt in rootfs/etc/profile.d/prompt.sh.

- Fix DEBAIN_DATECODE typo to DEBIAN_DATECODE in Dockerfile
- Fix malformed brace in bold variable check: "$bold"} -> "$bold"
- Fix path comparison logic in file_on_host function
- Quote KUBECONFIG variable in helm.sh for safety
- Add missing $ prefix to GEODESIC_TF_PROMPT_ENABLED variable
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

The changes fix typos, syntax errors, and missing variable references across build configuration and shell initialization scripts. These include correcting a build argument name, fixing shell test syntax, adding variable quoting for robustness, enabling proper variable expansion in conditionals, and modifying path-matching logic in a utility function.

Changes

Cohort / File(s) Summary
Build Configuration
os/debian/Dockerfile.debian
Corrected build argument name typo: DEBAIN_DATECODEDEBIAN_DATECODE for proper Debian base image tag construction.
Shell Script Fixes
rootfs/etc/profile.d/_10-colors.sh, rootfs/etc/profile.d/helm.sh, rootfs/etc/profile.d/prompt.sh, rootfs/etc/profile.d/_50-workspace.sh
Fixed syntax errors and variable references: removed stray } from conditional test, added quoting around KUBECONFIG variable, fixed missing $ prefix in variable expansion for condition check, and rewrote path-matching logic in utility function.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: correct syntax errors and typos in shell scripts' accurately summarizes the main changes across multiple files (Dockerfile and shell scripts) by highlighting the primary purpose of correcting syntax errors and typos.
Description check ✅ Passed The description is directly related to the changeset, providing detailed explanations of specific fixes made to each modified file (Dockerfile and shell scripts), with clear references to the types of corrections applied.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch parsing-and-syntax-error-fixes
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@rootfs/etc/profile.d/_50-workspace.sh`:
- Line 17: The mount-root comparison in the file_on_host check (the conditional
using "${file}" and "${path}") fails when GEODESIC_HOST_PATHS contains trailing
slashes; modify the conditional in file_on_host to normalize or strip trailing
slashes from path before comparison (e.g. use a normalized variable like
normalized_path="${path%/}" and compare "${file}" == "$normalized_path" or
"${file}" == "$normalized_path"*), or alternatively normalize both "${file}" and
"${path}" via parameter expansion before testing so exact mount roots are
correctly recognized (references: file_on_host, variables file and path used in
the conditional).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: be4bf5d9-9b46-4650-9be1-09ab7a5f9aec

📥 Commits

Reviewing files that changed from the base of the PR and between 99410d6 and 162bdf3.

📒 Files selected for processing (5)
  • os/debian/Dockerfile.debian
  • rootfs/etc/profile.d/_10-colors.sh
  • rootfs/etc/profile.d/_50-workspace.sh
  • rootfs/etc/profile.d/helm.sh
  • rootfs/etc/profile.d/prompt.sh

Comment thread rootfs/etc/profile.d/_50-workspace.sh
Copy link
Copy Markdown
Member

@osterman osterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@osterman osterman merged commit 42d67b5 into main Mar 23, 2026
4 checks passed
@osterman osterman deleted the parsing-and-syntax-error-fixes branch March 23, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants