Skip to content

Code review: fix bugs, test failures, and macOS compatibility issues#3

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/review-all-code-and-generate-report
Draft

Code review: fix bugs, test failures, and macOS compatibility issues#3
Copilot wants to merge 2 commits intomainfrom
copilot/review-all-code-and-generate-report

Conversation

Copy link

Copilot AI commented Mar 17, 2026

Review of the codebase identified several bugs causing test failures, a macOS incompatibility, and missing shell configuration. All 58 bats tests now pass (previously 18+ failing/hanging).

Bug Fixes

  • ((step++)) exit code trap — All 12 installXxx() functions opened with ((step++)). When step=0, the post-increment evaluates to 0, returning exit code 1 and aborting under set -e. Changed to ((step += 1)) across install_core.sh and install_software.sh.

  • xargs -r macOS incompatibility (zsh_aliases.zsh) — -r/--no-run-if-empty is GNU-only; not available on macOS. Replaced with an explicit [[ -n "$gone_branches" ]] guard.

  • Non-idempotent plugin clones (install_core.sh) — git clone for zsh-syntax-highlighting, zsh-autosuggestions, k, and powerlevel10k had no existence check, failing on reinstall. Added [ -d ... ] || guards.

  • ls glob error in doctor (doctor.sh) — ls "$LOG_DIR"/*.log exits non-zero and triggers word-splitting when no logs exist. Replaced with find -maxdepth 1 -name "*.log".

Missing Config

  • LM Studio CLI PATH (zsh_postload.zsh) — Added $HOME/.cache/lm-studio/bin to PATH so the lms CLI is available after install.

Test Fixes

  • M9 assertion wrong file (zshrc_config.bats) — git_clean_branches() lives in zsh_aliases.zsh, not zsh_postload.zsh.

  • bootstrap.bats I1 hangingPATH="/usr/bin:/bin" doesn't exclude git on Ubuntu (where /bin → /usr/bin). Updated to use a truly empty temp directory as PATH.

  • bootstrap.sh non-interactive support — Wrapped the directory prompt in [[ -z "${DEST:-}" ]] (skip if preset) and [[ -t 0 ]] (skip if no TTY), enabling both scripted use and test isolation.

Original prompt

This section details on the original issue you should resolve

<issue_title>Code review</issue_title>
<issue_description>Review all the code and generate a report
Implement improvements</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Fix ((step++)) -> ((step += 1)) in all 12 install functions (was failing in set -e contexts when step=0)
- Add LM Studio CLI PATH ($HOME/.cache/lm-studio/bin) to zsh_postload.zsh
- Fix M9 bats test: check zsh_aliases.zsh instead of zsh_postload.zsh for git_clean_branches
- Fix bootstrap.sh: add DEST preset check and TTY detection to support non-interactive use
- Fix bootstrap.bats I1: use truly empty PATH instead of /usr/bin:/bin (on Ubuntu, /bin == /usr/bin)
- Fix xargs -r macOS incompatibility in zsh_aliases.zsh (replace with explicit empty-check guard)
- Fix git plugin clone idempotency in installZsh (check dir existence before cloning)
- Fix ls glob in doctor.sh: use find instead to avoid errors when no logs exist

Co-authored-by: noofreuuuh <1218742+noofreuuuh@users.noreply.github.com>
Copilot AI changed the title [WIP] Review code and implement improvements Code review: fix bugs, test failures, and macOS compatibility issues Mar 17, 2026
Copilot AI requested a review from noofreuuuh March 17, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code review

2 participants