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

include_file option for single files #307

Closed
silverwind opened this issue Jul 8, 2022 · 2 comments · Fixed by #337
Closed

include_file option for single files #307

silverwind opened this issue Jul 8, 2022 · 2 comments · Fixed by #337

Comments

@silverwind
Copy link
Contributor

silverwind commented Jul 8, 2022

I like to exactly specify files and directories to be watched so air initializes quickly and does not iterate useless directories. This mostly fine using the include_dir option with a list of to-watch directories, but it's not possible watch files in the root directory without adding the root directory itself.

How about having a include_file option, where one can put single files to watch? E.g.

[build]
include_dir = ["modules", "libs"]
include_file = ["main.go"]
silverwind added a commit to silverwind/air that referenced this issue Oct 17, 2022
Useful option to specify individual files to watch. I renamed the
`watchDir` function to `watchPath` because it can also handle single
files fine (`filepath.Walk` emits a single file if passed a file path).

Fixes: air-verse#307
@silverwind
Copy link
Contributor Author

#337

@xiantang
Copy link
Collaborator

looks good

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 a pull request may close this issue.

2 participants