fileExists to support file globbing

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

XMLWordPrintable

      Hi - it would be really nice if the fileExists() step supported file globbing:

      if (fileExists('foo/bar*')) {
          // ... 
      }
      

      Currently the only way I can find to do this is an awkward use of the compgen command inside a try/catch, and this will only work on Unix:

      try {
          sh "compgen -G 'foo/bar*'"
          // ... 
      }
      catch (err) {
          pass
      }
      

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

              Created:
              Updated:
              Archived: