Skip to content

Conversation

@lacroixDj
Copy link
Collaborator

Fix: Make cask installation idempotent

Description

This PR improves the setup script to be fully idempotent and removes redundant code.

  • Add install_cask_if_missing() helper function to check if applications are already installed via Homebrew or in /Applications
  • Update all cask installations to skip if already installed, making the script safe to run multiple times
  • Remove setup-mac4dev-skip-installed.sh variant script as it's no longer needed
  • Disable time tracking functionality in the main setup script

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactor
  • Docs
  • Test
  • Build/CI

Checklist

  • Code follows project conventions
  • Self-reviewed the changes
  • Added/updated documentation if needed
  • No new warnings

- Add install_cask_if_missing() helper function to check if apps are already installed
- Update all cask installations to skip if already installed via Homebrew or in /Applications
- Make script fully idempotent - safe to run multiple times
- Add setup-mac4dev-skip-installed.sh variant that skips Homebrew, core tools, and IDEs
- Remove the skip-installed variant script as it's no longer needed
- Main script now handles idempotent installation checks
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the macOS setup script to be fully idempotent by adding a helper function that checks for existing installations before attempting to install Homebrew casks. The changes ensure the script can be safely run multiple times without reinstalling already-present applications.

Changes:

  • Added install_cask_if_missing() helper function to check Homebrew and /Applications before installing
  • Replaced all direct brew install --cask commands with calls to the new helper function
  • Fixed duplicate disabled field in Starship time configuration
  • Removed redundant iTerm2 installation check code (now handled by helper function)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

lacroixDj and others added 2 commits January 20, 2026 10:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lacroixDj lacroixDj requested a review from w3dani January 20, 2026 10:20
Copy link
Collaborator

@telekosmos telekosmos left a comment

Choose a reason for hiding this comment

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

Not as a common rule, given this one was entirely done by Cursor, I rely on the patch ☺️

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.

3 participants