Skip to content

Conversation

@codegen-sh
Copy link

@codegen-sh codegen-sh bot commented Mar 22, 2025

This PR fixes the WSL2 to Windows sync issues for the MCP-Tower distribution. The original scripts were failing to properly access the WSL2 distribution and sync files between Windows and WSL2.

Changes

  1. Fixed WSL2 Distribution Detection:

    • Added proper error handling for WSL2 distribution detection
    • Improved the pattern matching for distribution names
  2. Changed Sync Method:

    • Replaced robocopy with rsync through WSL2 for more reliable syncing
    • Added automatic installation of rsync if not present in the WSL2 distribution
  3. Added Combined Script:

    • Created wsl-codegen-init-combined.ps1 that handles both initialization and sync in one script
    • This simplifies the workflow to a single command
  4. Improved Error Handling:

    • Added more detailed error messages
    • Added verification steps for all paths and commands
  5. Added Documentation:

    • Created comprehensive documentation in wsl-codegen-tools-readme.md
    • Added troubleshooting section for common issues

Usage

# All-in-one solution
.\wsl-codegen-init-combined.ps1 -WindowsPath "C:\Users\L\Desktop\WORKSPACE" -DistroName "MCP-Tower" -WslPath "/home/l/Workspace"

# Or use the individual scripts
.\wsl-codegen-init-fixed.ps1 -WindowsPath "C:\Users\L\Desktop\WORKSPACE" -DistroName "MCP-Tower" -WslPath "/home/l/Workspace"
.\windows-wsl2-sync-fixed.ps1 -SourcePath "C:\Users\L\Desktop\WORKSPACE" -DistroName "MCP-Tower" -DestPath "/home/l/Workspace"

These changes should resolve the issues with accessing the MCP-Tower WSL2 distribution and ensure reliable synchronization between Windows and WSL2.

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.

0 participants