Last active
July 26, 2017 10:44
-
-
Save sharpred/93e4771880c83beab8aa43d46696024d to your computer and use it in GitHub Desktop.
gets build and revision number from failed deliver job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var regex = /(ERROR ITMS-90189: "Redundant Binary Upload. There already exists a binary upload with build ')([0-9.]{5})(.)([0-9.]{10})(.*)/g; | |
var str = `ERROR ITMS-90189: "Redundant Binary Upload. There already exists a binary upload with build '1.8.0.1501059235' for version '1.8.0'"`; | |
var m, version, buildNo; | |
while ((m = regex.exec(str)) !== null) { | |
// This is necessary to avoid infinite loops with zero-width matches | |
if (m.index === regex.lastIndex) { | |
regex.lastIndex++; | |
} | |
version = m[2] ? m[2] : undefined; | |
buildNo = m[4] ? m[4] : undefined; | |
console.log("version and build", version, buildNo); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment