Skip to content

fix: use realpath for main module detection in service - #16

Merged
athal7 merged 1 commit into
mainfrom
fix-main-module-detection
Jan 2, 2026
Merged

fix: use realpath for main module detection in service#16
athal7 merged 1 commit into
mainfrom
fix-main-module-detection

Conversation

@athal7

@athal7 athal7 commented Jan 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix brew services not starting by using realpath comparison for main module detection
  • The simple string comparison of import.meta.url vs process.argv[1] fails on macOS due to symlink resolution differences (/tmp vs /private/tmp, /opt/homebrew/opt vs /opt/homebrew/Cellar)

This was causing launchd to start the process but immediately exit because the main module check returned false.

The simple string comparison of import.meta.url vs process.argv[1]
fails on macOS due to symlink resolution differences:
- /tmp vs /private/tmp
- /opt/homebrew/opt vs /opt/homebrew/Cellar

This caused brew services to fail because launchd runs the script
via the symlinked path but import.meta.url resolves to the real path.
@athal7
athal7 merged commit b9d7f3f into main Jan 2, 2026
1 check passed
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