Debian Codegraph @

Guardfile

raw
1 guard :shell do
2 watch /^selfupdate\/.+\.go$/ do |m|
3 puts "#{Time.now}: #{m[0]}"
4 case m[0]
5 when /_test\.go$/
6 parent = File.dirname m[0]
7 sources = Dir["#{parent}/*.go"].reject{|p| p.end_with? '_test.go'}.join(' ')
8 system "go test -v -short #{m[0]} #{sources}"
9 else
10 system 'go build ./selfupdate/'
11 end
12 end
13
14 watch /^cmd\/selfupdate-example\/.+\.go$/ do |m|
15 puts "#{Time.now}: #{m[0]}"
16 system 'go build ./cmd/selfupdate-example/'
17 end
18 end