File: Guardfile

package info (click to toggle)
golang-github-rhysd-go-github-selfupdate 1.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 348 kB
  • sloc: sh: 21; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 493 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
guard :shell do
  watch /^selfupdate\/.+\.go$/ do |m|
    puts "#{Time.now}: #{m[0]}"
    case m[0]
    when /_test\.go$/
      parent = File.dirname m[0]
      sources = Dir["#{parent}/*.go"].reject{|p| p.end_with? '_test.go'}.join(' ')
      system "go test -v -short #{m[0]} #{sources}"
    else
      system 'go build ./selfupdate/'
    end
  end

  watch /^cmd\/selfupdate-example\/.+\.go$/ do |m|
    puts "#{Time.now}: #{m[0]}"
    system 'go build ./cmd/selfupdate-example/'
  end
end