Improve how to get output of sh execution

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

XMLWordPrintable

      Usually when you execute some shell script and you need to reuse the output for another shell script or internal you need to do something like:

      sh('git rev-parse HEAD > GIT_COMMIT')
      git_commit=readFile('GIT_COMMIT')
      

      This is ok, but maybe we could provide something like:

      git_commit = sho('git rev-parse HEAD')
      

      sho = shell output
      which basically takes the output and put it in a var.

      Another option could be adding a parameter to sh that indicates that we want to capture the outout and return it back.

            Assignee:
            Jesse Glick
            Reporter:
            Alex Soto
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: