Skip to content

Commit

Permalink
feat(gapic-ruby-generator): add tool to stop background process from …
Browse files Browse the repository at this point in the history
…toys gen
  • Loading branch information
aandreassa committed Jan 23, 2024
1 parent 9d7f5b5 commit 6b5d94a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .toys/.toys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,19 @@ def run
end
end

tool "gen stop" do
desc "Stops all processes spawned via toys gen"

def run
toys_gen_pids = `ps aux`.each_line.filter_map { |line| line.split[1].to_i if line.match?(/ruby.*protoc/)}
puts "No toys gen processes running." if toys_gen_pids.empty?
toys_gen_pids.each do |pid|
puts "Terminating pid #{pid}"
Process.kill("TERM", pid)
end
end
end

tool "bin" do
desc "Regenerates binary input for goldens"

Expand Down

0 comments on commit 6b5d94a

Please sign in to comment.