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
      }
      

          [JENKINS-38855] fileExists to support file globbing

          Edward Easton created issue -
          Edward Easton made changes -
          Description Original: Hi - it would be really nice if the fileExists() step supported file globbing:

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

          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:
          {code}
          try {
              sh "compgen 'foo/bar*"
              // ...
          }
          catch (err) {
              pass
          }
          {code}
          New: Hi - it would be really nice if the fileExists() step supported file globbing:

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

          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:
          {code}
          try {
              sh "compgen 'foo/bar*'"
              // ...
          }
          catch (err) {
              pass
          }
          {code}
          Edward Easton made changes -
          Description Original: Hi - it would be really nice if the fileExists() step supported file globbing:

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

          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:
          {code}
          try {
              sh "compgen 'foo/bar*'"
              // ...
          }
          catch (err) {
              pass
          }
          {code}
          New: Hi - it would be really nice if the fileExists() step supported file globbing:

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

          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:
          {code}
          try {
              sh "compgen -G 'foo/bar*'"
              // ...
          }
          catch (err) {
              pass
          }
          {code}
          Jesse Glick made changes -
          Component/s New: pipeline-utility-steps-plugin [ 21135 ]
          Component/s Original: pipeline-build-step-plugin [ 21707 ]
          Andrew Bayer made changes -
          Component/s New: workflow-basic-steps-plugin [ 21712 ]
          Component/s Original: pipeline-utility-steps-plugin [ 21135 ]
          Andrew Bayer made changes -
          Component/s New: pipeline-utility-steps-plugin [ 21135 ]
          Component/s Original: workflow-basic-steps-plugin [ 21712 ]

            Unassigned Unassigned
            eeaston Edward Easton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: