Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import groovy.json.JsonSlurper
- def readHashedVersion(packagejson, packageName, section) {
- def packageSlurper = new JsonSlurper()
- def packageJson = packageSlurper.parse file(packagejson)
- def dep = packageJson.get(section).get(packageName)
- def hash = dep.substring(dep.lastIndexOf('#') + 1)
- return hash;
- }
- ext {
- readHashedVersion = this.&readHashedVersion
- }
Add Comment
Please, Sign In to add comment