vcastellm / guard-go

Run and restart go programs when changed
MIT License
24 stars 13 forks source link

go run no longer produces a.out in ps [go1.1.1] #5

Closed trashhalo closed 10 months ago

trashhalo commented 11 years ago

The process kill based on finding a.out in ps (or killall a.out) doesn't seem to work after upgrading to go 1.1.1. It seems its now naming executables after the file name passed to run. We need to come up with a more clever way to find the go process.

thokra commented 11 years ago

I changed the ps_go_pid in runner.rb to this:

def ps_go_pid
  out = `ps -A -o pid,command | grep '_obj/exe/[#{@options[:server][0]}]#{@options[:server][1..-4]}'`.split($/).each do |line|
    line.split(" ").first
  end
end

and it seems to work well in my project. I've only tested it on Linux Mint 15, and it will probably not work in other versions of go. It's looking for obj_/exe/{filename}.

trashhalo commented 11 years ago

Much better! feel free to close out my other my other ticket.

vcastellm commented 11 years ago

Could you make this a PR?

Thanks

thokra commented 11 years ago

Will do, just want to do some more testing on it. And maybe add a go version check or something. Or do you want to just target 1.1.1?

vcastellm commented 11 years ago

Would be great to show a message for < 1.1.1 users

iPhone := true

El 09/08/2013, a les 10:58, Thomas Krampl notifications@github.com va escriure:

Will do, just want to do some more testing on it. And maybe add a go version check or something. Or do you want to just target 1.1.1?

— Reply to this email directly or view it on GitHub.