Skip to content
This repository was archived by the owner on Apr 11, 2021. It is now read-only.
This repository was archived by the owner on Apr 11, 2021. It is now read-only.

Guard shell run_all run multiple times #29

@louim

Description

@louim

Hey!

I have a simple guard-shell command to run a rake task when file change:

guard :shell, first_match: true do
  watch(%r{^app/graphql/(mutations.*|types.*|fx_api_schema\.rb)$}) do |m|
    #following line is for debugging purposes
    Guard::UI.info "The original match is: #{m.inspect}"
    `bin/rake graphql:schema:idl`
  end
end

It works ok when saving one of the files matching, but when I run all with guard, it tries to run that task once for each files that matches (in my case, around 75 times). I even tried the block above with only the inspect line to see if that was related to the task itself and it still printed all matches.

When I try the above block in another guard plugin block for example rubocop or rspec, I get no printout at all on the all run.

I have seen #17, but adding the first_match doesn't help (as expected, because it's only one watch block).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions