-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
Hi, it would be really nice if there was a dirExists() function that worked like fileExists()
Currently the only way to do this is to use a complicated subshell which clutters up the logs:
def dirExists(path) { def exists = sh returnStdout: true, script: """path=\$(compgen -G \"${path}\") || true if [ ! -z \"\$path\" -a -d \"\$path\" ]; then echo true else echo false fi """ return (exists == 'true') }
Probably simpler (untested):