This issue is archived. You can view it, but you can't modify it. Learn more

ExportXMLWordPrintable

      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')
      }
      

            Assignee:
            Unassigned
            Reporter:
            Edward Easton
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: