firmware_tools/Common_scripts/commandline/commandline.groovy
Damian Smith 02db7b9453 Add 'Common_scripts/' from commit '0150bf139f'
git-subtree-dir: Common_scripts
git-subtree-mainline: 7d3b54f293
git-subtree-split: 0150bf139f
2018-11-27 13:46:52 +00:00

13 lines
No EOL
298 B
Groovy

String getCommandOutput(String cmd) {
if (isUnix()) {
return sh(returnStdout: true, script: '#!/bin/sh -e\n' + cmd).trim()
} else {
return bat(returnStdout: true, script: """
@echo off
${cmd}
"""
).trim()
}
}
return this