Groovy web console

subscribe to the feed Subscribe
to this
site

Did File Change

Published 3 weeks ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts

def getChangedFiles() {
  return ['go/test/test.go', 'test']
}

def didFileChange(reg) {
  return !!getChangedFiles()
    .find { it ==~ reg }
}

a = 1
if (didFileChange('go/.*.go')) {
  print 'yes'
} else {
  print 'no'
}