Merge commit '06ca80c596'
This commit is contained in:
commit
1f21e0f2b9
1 changed files with 17 additions and 7 deletions
|
|
@ -553,14 +553,24 @@ class MetaInfo extends GISJsonSerialised {
|
|||
deserialiseJson(rawmeta)
|
||||
}
|
||||
|
||||
String relativize(String path) {
|
||||
def Path thispath = Paths.get(path)
|
||||
if (thispath.startsWith(script.WORKSPACE)) {
|
||||
def Path wspath = Paths.get(script.WORKSPACE)
|
||||
def Path wsrelativePath = wspath.relativize(thispath)
|
||||
return wsrelativePath.toString()
|
||||
String relativize(String mypath) {
|
||||
String pathRelative
|
||||
script.echo("Seeing if ${mypath} begins with ${script.WORKSPACE}")
|
||||
if (mypath.startsWith(script.WORKSPACE)) {
|
||||
pathRelative = mypath.minus(script.WORKSPACE)
|
||||
script.echo("Extracted ${pathRelative} from ${script.WORKSPACE} and ${mypath}")
|
||||
} else {
|
||||
pathRelative = mypath
|
||||
script.echo("Path relative is unchanged: ${pathRelative}")
|
||||
}
|
||||
return path
|
||||
// Convert \ with /
|
||||
pathRelative = pathRelative.tokenize('\\').join('/')
|
||||
// Strip leading / if any
|
||||
pathRelative = pathRelative.replaceAll('^/+', '')
|
||||
|
||||
script.echo("Path relative is ${pathRelative}")
|
||||
|
||||
return pathRelative
|
||||
}
|
||||
|
||||
static String metafilepath() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue