-
Notifications
You must be signed in to change notification settings - Fork 260
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
Watch include exclude #94
Conversation
I've replaced the |
@malobre awesome! Thanks for tackling this. I would actually be in favor of preserving the current |
How about:
|
@malobre perhaps. However, that is how cargo-watch does it. It may feel familiar to some. Also, Thoughts? |
That's a valid point, I do not feel strongly about one or the other. I'll name them however you like :-) |
I dig it. Let's do @malobre thanks for the discussion! Ping me when this guy is ready for review. Thanks again for the work on this. |
I think most of the work is done, I still need to do a little more testing though. I've only tested this:
Which seems to work ! |
Tested:
|
@thedodd Ready for review ! |
I just pushed a small change that enhance the help messages:
becomes
The same goes for |
@malobre woot woot! Very nice! Two things that I will ask real quick before I review (I'll add these to the PR template as well):
Thanks again for all this work! I should be able to get this reviewed, merged & released over the next few days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of small changes. All in all, this is top-notch! Thanks @malobre!
Woops looks like I messed up my rebase a little bit. I'll fix that. |
The new option allows to watch specific folder(s) or file(s) when using the `serve` or `watch` subcommand.
@malobre hey boss. Just following-up with you here. Looks like linting is failing for various reasons. I have a PR I'm about to merge which will hopefully address some of that stuff. I'll update this branch after that. Once it is updated, if there are still clippy issues, then it means that they are unique to your PR |
Okay, no problem. Ping me when needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 excellent work! Sorry for the amount of time it took for me to do the final review on this and get it merged!
/// Paths to watch, defaults to the build target parent directory. | ||
pub paths: Vec<PathBuf>, | ||
/// Paths to ignore. | ||
pub ignored_paths: Vec<PathBuf>, | ||
} | ||
|
||
impl RtcWatch { | ||
pub(super) fn new(build_opts: ConfigOptsBuild, opts: ConfigOptsWatch) -> Result<Self> { | ||
let build = Arc::new(RtcBuild::new(build_opts)?); | ||
|
||
let paths = { | ||
let mut paths = opts.watch.unwrap_or_default(); | ||
|
||
if paths.is_empty() { | ||
paths.push( | ||
build | ||
.target | ||
.parent() | ||
.ok_or_else(|| anyhow!("couldn't get parent of {:?}", build.target))? | ||
.to_path_buf(), | ||
) | ||
} | ||
|
||
paths | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this will not include the target dir's parent dir if it is not explicitly declared. That's fine. Just adding a note here. After I merge this, I'll update the docs to state that info.
No worries, we all have stuff going on in our lives. :) |
@malobre just wanted to give you a heads-up that we will be releasing this shortly! Should land in the 0.8.0 release. |
This adds the
--watch <path>...
option to theserve
andwatch
subcommands which allows to watch specific folder(s) or file(s).Closes #93
Checklist
Updated README.md with pertinent info (may not always apply).