Skip to content
New issue

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

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

Already on GitHub? # to your account

Fixed WatchChanges not properly removing subdirectories from watch list #908

Merged
merged 4 commits into from
Aug 13, 2015

Conversation

daniel-chambers
Copy link
Contributor

In the scenario where WatchChanges is used with multiple includes, if one include is a subdirectory of another, WatchChanges will not watch the correct directory.

For example:

use watcher = 
    !! "parent/*.*" ++ "parent/child/*.*"
    |> WatchChanges (fun changes ->
        tracefn "%A" changes)

/parent/child will be watched (incorrectly), instead of /parent.

This PR fixes this issue and refactors the code a little in order to implement a couple of tests to ensure the correct behaviour when eliminating subdirectories from the watch list.

@forki
Copy link
Member

forki commented Aug 13, 2015

could you please look at the build error?

@daniel-chambers
Copy link
Contributor Author

Damn, it seems like a failure when building on Mono because of paths in the tests. Do you guys have a way of automatically handling the difference between \ on Windows and / on *nix?

@forki
Copy link
Member

forki commented Aug 13, 2015

there should be a normalizepath function somewhere in the repo. just call that

@daniel-chambers
Copy link
Contributor Author

Fixed :)

I used an internal function from Globbing, which makes me a little uncomfortable, but it was the only one I found.

forki added a commit that referenced this pull request Aug 13, 2015
Fixed WatchChanges not properly removing subdirectories from watch list
@forki forki merged commit 70ec26f into fsprojects:master Aug 13, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants