Skip to content

Conversation

@mixberrymc
Copy link

Description

Fixes the regolith watch command failing on macOS with the error:

[ERROR] Could not start watching `./packs/RP`
[ERROR] lstat packs/RP/...: no such file or directory

Problem

The watch command was using the experimental "..." recursive watching syntax (filepath.Join(root, "...")) from the fsnotify fork, which doesn't work reliably on macOS.

Solution

  • Replaced the "..." syntax with filepath.WalkDir to manually traverse and add each subdirectory to the watcher
  • Added the os import for os.DirEntry
  • This approach provides better cross-platform compatibility

Testing

Tested on:

  • macOS (darwin/amd64) - ✅ Watch command now works
  • The fix maintains compatibility with the existing watcher behavior on other platforms

Changes

  • Modified regolith/watcher.go:
    • Updated watch() function to use filepath.WalkDir
    • Added os to imports

Refactor directory watching to add root and subdirectories for macOS compatibility.
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.

1 participant