Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(run): add --watch flag #634

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ratson
Copy link
Contributor

@ratson ratson commented Nov 20, 2024

Add --watch flag for ags run.

Copy link

@NathanC NathanC left a comment

Choose a reason for hiding this comment

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

LGTM! I don't know Go so just did a quick sanity review. Excited for this feature, I currently have a hacked together version of the functionality.

}
}()

err = watcher.Add(targetDir)
Copy link

Choose a reason for hiding this comment

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

consider excluding .git from the directory, otherwise this will restart on e.g., making a commit if the .config/ags is a git repo.

return
}
log.Println("event:", event)
if event.Has(fsnotify.Write) {
Copy link

Choose a reason for hiding this comment

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

Remove events don't seem like they'll be caught here (rename and create ones will also fire a Write it looks like). That's probably fine but worth a comment IMO

@Aetherall
Copy link

Aetherall commented Jan 2, 2025

Hi !
I think you can rely on esbuild watch mode and hook the onEnd handler in a plugin to restart the gjs child :)
It might save some trouble afterwards, builders know about imports, loaders etc

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