Add bat variant of git commands
This commit is contained in:
parent
9cb07c5f16
commit
bf616a38a1
1 changed files with 14 additions and 2 deletions
|
|
@ -32,11 +32,23 @@ class ProductInfo extends GISJsonSerialised {
|
|||
|
||||
void set(String productname, String subcomponentname, String jirakey) {
|
||||
// Make sure the fields can be used in git tags
|
||||
def int pstatus = script.sh(script: "git check-ref-format --normalize \"refs/tags/${productname}\" >/dev/null 2>/dev/null", , returnStatus: true)
|
||||
def int pstatus = 0
|
||||
if (script.isUnix()) {
|
||||
pstatus = script.sh(script: "git check-ref-format --normalize \"refs/tags/${productname}\" >/dev/null 2>/dev/null", , returnStatus: true)
|
||||
}
|
||||
else {
|
||||
pstatus = script.bat(script: "@git check-ref-format --normalize \"refs/tags/${productname}\" > NUL 2> NUL", , returnStatus: true)
|
||||
}
|
||||
if (pstatus > 0) {
|
||||
script.error("The product name: ${productname} needs to be renamed as it cannot be used in a git tag name")
|
||||
}
|
||||
def int sstatus = script.sh(script: "git check-ref-format --normalize \"refs/tags/${subcomponentname}\" >/dev/null 2>/dev/null", , returnStatus: true)
|
||||
def int sstatus = 0
|
||||
if (script.isUnix()) {
|
||||
sstatus = script.sh(script: "git check-ref-format --normalize \"refs/tags/${subcomponentname}\" >/dev/null 2>/dev/null", , returnStatus: true)
|
||||
}
|
||||
else {
|
||||
sstatus = script.bat(script: "@git check-ref-format --normalize \"refs/tags/${subcomponentname}\" > NUL 2> NUL", , returnStatus: true)
|
||||
}
|
||||
if (sstatus > 0) {
|
||||
script.error("The subcomponent name: ${subcomponentname} needs to be renamed as it cannot be used in a git tag name")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue