You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes there are situations where responding to changes doesn't make sense, e.g. while switching git branches.
In this case, we still want to monitor changes (instead of pausing), but we don't want to run any Guard plugins. E.g. we don't want to run any changes unless the branch is 'master'.
Implementation: not sure.
Alternative 1: wrapping every watch block to return nil if a given condition evaluates to true.
Alternative 2: wrapping everything in a group with halt_on_fail and having the first task "fail" if a condition is true.
Alternative 3: monkey-patching Guard to not run tasks when a condition is true
The text was updated successfully, but these errors were encountered:
I've also run into this problem, specifically trying to prevent Guard running any plugins when switching git branches. I've added a couple of potential solutions to this gem: https://github.com/dp28/guard-git.
One of the solutions is a custom matcher that essentially returns nil unless the files that triggered the change have been modified since the last commit.
The other solution monkey-patches Guard's watch method to automatically apply this custom matcher.
Sometimes there are situations where responding to changes doesn't make sense, e.g. while switching git branches.
In this case, we still want to monitor changes (instead of pausing), but we don't want to run any Guard plugins. E.g. we don't want to run any changes unless the branch is 'master'.
Implementation: not sure.
Alternative 1: wrapping every
watch
block to return nil if a given condition evaluates to true.Alternative 2: wrapping everything in a
group
withhalt_on_fail
and having the first task "fail" if a condition is true.Alternative 3: monkey-patching Guard to not run tasks when a condition is true
The text was updated successfully, but these errors were encountered: