Handle directories that are matched as files #14

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@pgib

pgib commented May 2, 2013

The file watcher can inadvertently pick up directories that have extensions in their name (Dir.glob("**/*.*")). This causes FileUtils.cp(from_path, to_path) to throw an exception.

Instead of attempting to copy a source directory that was picked up a…
…s a file because its name contains an extension using FileUtils.cp which throws an exception, warn the user and ignore.
@pgib

This comment has been minimized.

Show comment Hide comment
@pgib

pgib May 2, 2013

I'm not sure if it would be better to handle this in a different way, but when you have some directories in a watched source that have a dirname.ext type name (not by choice, mind you!), guard-copy throws an exception and is fired by Guard.

pgib commented May 2, 2013

I'm not sure if it would be better to handle this in a different way, but when you have some directories in a watched source that have a dirname.ext type name (not by choice, mind you!), guard-copy throws an exception and is fired by Guard.

marcisme added a commit that referenced this pull request May 3, 2013

warn when changed paths are directories
Simply ignoring this case may be sufficient, but we'll leave it as a
warning for now. This should address #14.
@marcisme

This comment has been minimized.

Show comment Hide comment
@marcisme

marcisme May 3, 2013

Owner

Thanks for the pull request.

I think it'd be appropriate to rescue the exception instead of hitting the disk an extra time before every copy, and I've pushed up a commit that does that.

Please try your case against master, and let me know if this change works for you.

Owner

marcisme commented May 3, 2013

Thanks for the pull request.

I think it'd be appropriate to rescue the exception instead of hitting the disk an extra time before every copy, and I've pushed up a commit that does that.

Please try your case against master, and let me know if this change works for you.

@pgib

This comment has been minimized.

Show comment Hide comment
@pgib

pgib May 3, 2013

@marcisme That did the trick!

pgib commented May 3, 2013

@marcisme That did the trick!

@pgib pgib closed this May 3, 2013

@marcisme

This comment has been minimized.

Show comment Hide comment
@marcisme

marcisme May 5, 2013

Owner

Thanks for testing. This is now released in v0.0.8.

Owner

marcisme commented May 5, 2013

Thanks for testing. This is now released in v0.0.8.

@pgib

This comment has been minimized.

Show comment Hide comment
@pgib

pgib May 5, 2013

dancing

pgib commented May 5, 2013

dancing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment