Skip to content

Add automatic repository update mechanism#6

Merged
bbernstein merged 3 commits intomainfrom
feature/automatic-repository-updates
Sep 9, 2025
Merged

Add automatic repository update mechanism#6
bbernstein merged 3 commits intomainfrom
feature/automatic-repository-updates

Conversation

@bbernstein
Copy link
Copy Markdown
Owner

Summary

This PR adds a comprehensive automatic update mechanism that allows LacyLights to check for and install updates from all three repositories (lacylights-fe, lacylights-node, lacylights-mcp) before launching.

Changes

🔄 update-repos.sh - Core Update Script

  • Checks all three repositories for updates from remote origins
  • Safely handles uncommitted changes with warnings
  • Uses pushd/popd for safe directory navigation
  • Automatically installs dependencies when package.json changes
  • Rebuilds TypeScript projects after updates
  • Multiple modes:
    • --check or -c: Check for updates only
    • --auto or -y: Update automatically without prompting
    • Default: Interactive mode with user prompts

📱 LacyLights.app Integration

  • App now automatically checks for updates on launch
  • Prompts user to update if new versions are available
  • Seamlessly integrates with existing launch flow
  • Enhanced terminal output with colors and status messages

🛠️ update.sh - Convenience Wrapper

  • Simple command: ./update.sh
  • Forwards all arguments to update-repos.sh
  • Easy to remember interface

📖 Documentation Updates

  • Updated README.md with comprehensive update instructions
  • Documents both automated and manual update processes
  • Explains macOS app update features

Usage Examples

# Check for updates without installing
./update.sh --check

# Update all repositories (with prompts)
./update.sh

# Update automatically without prompts
./update.sh --auto

Problem Solved

Previously, LacyLights.app used whatever was currently in the directories without checking for newer versions. Now it ensures users always have the latest versions of all three repositories when launching the platform.

Safety Features

  • ✅ Detects uncommitted changes and warns users
  • ✅ Safe directory navigation with pushd/popd
  • ✅ Validates working directory before operations
  • ✅ Enhanced error messages with full paths
  • ✅ Automatic dependency installation
  • ✅ TypeScript project rebuilding

Test Plan

  • Script correctly detects updates in all three repositories
  • Safe handling of directory navigation
  • Proper error handling for missing repositories
  • Integration with LacyLights.app launch process
  • Update mechanism works with uncommitted changes

🤖 Generated with Claude Code

bbernstein and others added 2 commits September 9, 2025 14:25
- Add update-repos.sh script for checking and updating all three repositories
- Integrate update check into LacyLights.app launch process
- Add update.sh convenience script for manual updates
- Update README.md with documentation for update functionality
- App now prompts to update before launching if updates are available

Features:
- Detects uncommitted changes and warns user
- Checks for updates from remote repositories
- Updates dependencies when package.json changes
- Rebuilds TypeScript projects after updates
- Supports auto-update mode and check-only mode

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace cd/cd.. with pushd/popd for safer directory navigation
- Add script directory detection to ensure proper working directory
- Add better error messages showing full paths for debugging
- Verify we're in the lacylights directory before starting

This fixes the "fatal: not a git repository" error when running updates.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 9, 2025 18:46
Copy link
Copy Markdown

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 adds a comprehensive automatic update mechanism that allows LacyLights to check for and install updates from all three repositories (lacylights-fe, lacylights-node, lacylights-mcp) before launching.

  • Implements a new update-repos.sh script with comprehensive repository update capabilities
  • Converts the existing update.sh to a simple wrapper that calls update-repos.sh
  • Integrates automatic update checking into the macOS app launcher

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
update.sh Simplified to act as a wrapper script that forwards arguments to update-repos.sh
update-repos.sh New comprehensive script that handles checking and updating all three repositories
README.md Updated documentation to include new update commands and macOS app features
LacyLights.app/Contents/MacOS/LacyLights Added automatic update checking functionality to the app launcher

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread update-repos.sh Outdated
Comment thread update-repos.sh Outdated
Comment thread update-repos.sh Outdated
Comment thread update-repos.sh Outdated
Comment thread LacyLights.app/Contents/MacOS/LacyLights
- Use modern [[ ]] instead of [ ] for string comparisons in update-repos.sh
- Add proper error handling for npm ci fallback with warning message
- Add explicit error handling for build failures instead of silent || true
- Fix inverted update check logic - script now returns proper exit codes:
  * Exit 0 when updates are available (so if statement executes)
  * Exit 1 when no updates available (so if statement is skipped)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bbernstein bbernstein merged commit dadd10d into main Sep 9, 2025
@bbernstein bbernstein deleted the feature/automatic-repository-updates branch September 9, 2025 21:02
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.

2 participants