You've already forked jenkins-lib
mirror of
https://github.com/firstBitMarksistskaya/jenkins-lib.git
synced 2025-07-16 06:24:16 +02:00
Проверка на существование файла vrunner перед чтение его свойств
This commit is contained in:
@ -31,6 +31,10 @@ class VRunner {
|
|||||||
static boolean configContainsSetting(String configPath, String settingName) {
|
static boolean configContainsSetting(String configPath, String settingName) {
|
||||||
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()
|
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()
|
||||||
|
|
||||||
|
if (!steps.fileExists(configPath)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
String fileContent = steps.readFile(configPath)
|
String fileContent = steps.readFile(configPath)
|
||||||
return fileContent.contains("\"$settingName\"")
|
return fileContent.contains("\"$settingName\"")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user