mirror of
https://github.com/firstBitMarksistskaya/jenkins-lib.git
synced 2024-12-04 10:34:42 +02:00
Добавил приведение к абсолютному пути.
This commit is contained in:
parent
19951749c2
commit
923725a750
@ -78,8 +78,8 @@ class GetExtensions implements Serializable {
|
|||||||
localPathToExtension.copyFrom(new URL(extension.path))
|
localPathToExtension.copyFrom(new URL(extension.path))
|
||||||
} else {
|
} else {
|
||||||
// If the path is a local file, copy the file
|
// If the path is a local file, copy the file
|
||||||
// String localPath = extension.path.startsWith("./") ? "$env.WORKSPACE/${extension.path.substring(1)}" : extension.path
|
String localPath = getAbsolutePath(extension.path)
|
||||||
FilePath localFilePath = FileUtils.getFilePath(extension.path)
|
FilePath localFilePath = FileUtils.getFilePath(localPath)
|
||||||
localPathToExtension.copyFrom(localFilePath)
|
localPathToExtension.copyFrom(localFilePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -113,4 +113,13 @@ class GetExtensions implements Serializable {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getAbsolutePath(String path) {
|
||||||
|
// Если путь начинается с / или начинается с \\, или начинается с "Буквы диска" и ":"(Прим C:) то это абсолютный путь
|
||||||
|
if (path.startsWith("/") || path.startsWith("\\\\") || path.matches("^[A-Za-z]:.*")) {
|
||||||
|
return path
|
||||||
|
} else {
|
||||||
|
return "${env.WORKSPACE}/${path}"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user