offsetpath field in meta files was absolute; should be relative to workspace
This commit is contained in:
parent
d66b7b80d6
commit
736f0ece67
1 changed files with 6 additions and 9 deletions
|
|
@ -553,17 +553,14 @@ class MetaInfo extends GISJsonSerialised {
|
|||
deserialiseJson(rawmeta)
|
||||
}
|
||||
|
||||
String relativize(String path) {
|
||||
def Path mypath = Paths.get(path)
|
||||
String relativize(String mypath) {
|
||||
String pathRelative
|
||||
script.echo("Seeing if ${path} begins with ${script.WORKSPACE}")
|
||||
if (path.startsWith(script.WORKSPACE)) {
|
||||
def Path wspath = Paths.get(script.WORKSPACE)
|
||||
def Path wsrelativePath = wspath.relativize(mypath)
|
||||
pathRelative = wsrelativePath.toString()
|
||||
script.echo("Extracted ${pathRelative} from ${wspath.toString()} and ${mypath.toString()}")
|
||||
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.toString()
|
||||
pathRelative = mypath
|
||||
script.echo("Path relative is unchanged: ${pathRelative}")
|
||||
}
|
||||
return pathRelative
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue