Skip to content

Instantly share code, notes, and snippets.

@ebouchut
Created November 24, 2014 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebouchut/ca8ebc58bbac23a46265 to your computer and use it in GitHub Desktop.
Save ebouchut/ca8ebc58bbac23a46265 to your computer and use it in GitHub Desktop.
Guard workaround to symlinks pointing to parent directories (another option is https://github.com/guard/listen/releases/tag/v2.8.1)
############
## Problem
############
bundle exec guard
...
(This may be due to symlinks pointing to parent directories).
Duplicate: /some/where/ebouchut/www/netadge/bo/rubymine/trunk/doc/simplecov
which already is added as: /some/where/ebouchut/www/netadge/bo/rubymine/trunk/doc/simplecov
Listen is refusing to continue, because this may likely result in
an infinite loop.
Suggestions:
1) (best option) watch only directories you care about, e.g.
either symlinked folders or folders with the real directories,
but not both.
2) reorganize your project so that watched directories do not
contain symlinked directories
3) submit patches so that Listen can reliably and quickly (!)
detect symlinks to already watched read directories, skip
them, and then reasonably choose which symlinked paths to
report as changed (if any)
4) (not worth it) help implement a "reverse symlink lookup"
function in Listen, which - given a real directory - would
return all the symlinks pointing to that directory
Issue: https://github.com/guard/listen/issues/259
W, [2014-11-24T11:22:10.573170 #21218] WARN -- : build crashed: #<RuntimeError: Failed due to looped symlinks>
############
Workaround
############
bundle exec guard -d -w app lib test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment