12 lines
No EOL
283 B
Groovy
12 lines
No EOL
283 B
Groovy
String getCommandOutput(String cmd) {
|
|
if (isUnix()) {
|
|
return sh(returnStdout: true, script: '#!/bin/sh -e\n' + cmd).trim()
|
|
} else {
|
|
return powershell(returnStdout: true, script: """
|
|
${cmd}
|
|
"""
|
|
).trim()
|
|
}
|
|
}
|
|
|
|
return this |