(binding)
| 43 | VERSION_FILE = 'version.bzl' |
| 44 | |
| 45 | def self.version(binding) |
| 46 | match = File.read(VERSION_FILE).match(/^\s*"#{binding}": "([^"]+)"/) |
| 47 | raise "No #{binding} entry in #{VERSION_FILE}" unless match |
| 48 | |
| 49 | match[1] |
| 50 | end |
| 51 | |
| 52 | def self.write_version(binding, new_version) |
| 53 | text = File.read(VERSION_FILE).sub(/^(\s*"#{binding}": ")[^"]+(")/, "\\1#{new_version}\\2") |