I need to verify whether any file exists in .doc format in a specific directory. based on which when the condition will be executed.
i.e) when a file found inside a directory with the .doc extension it should proceed to execute steps.
Below code is unable to find the files in .doc format
when {
expression
{
return (fileExists("""${Path}/${version}/test/*.doc"""))
}
}
Use findFiles, fileExists doesn't support wildcards.
when {
expression {
return (findFiles(glob: "${Path}/${version}/test/*.doc").length > 0)
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With