Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-31691

add a step to determine if the current node is windows or not.

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • pipeline
    • None

      it is often usefull in reusable code to know if you are running on a windows slave or not.

      For example you may want to invoke maven - but on windows you need bat 'mvn ...' and Unix like systems sh ' mvn...'

      The current workaround involves a function like

      boolean isWindows() {
          return env.OS == 'Windows_NT'
      }
      

      but this is not ideal.

      so please implement something that can be more reliable to determine a windows node. (get the path separator, directory seporator - or just isCurrentNodeWindows())

            jglick Jesse Glick
            teilo James Nord
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: