我的问题是,ant任务alwas的输出在开头有一些[ssh-exec]信息文本.我能抑制/禁用吗?
我的代码到目前为止:
def ant = new AntBuilder()
// .... variable definition ...
ant.sshexec(host: host,
port: port,
trust: true,
username: username,
password: password,
command: 'ls')
>>> output:
[sshexec] Connecting to foomachine.local:22
[sshexec] cmd : ls
[sshexec] oldarchive.gz
[sshexec] newarchive.gz
[sshexec] empty-db.sh
[sshexec] testfile.py
Run Code Online (Sandbox Code Playgroud)
我只想要cmd的原始输出执行...
一些想法?!
Chr*_*orf 10
您可以将原始输出保存在Ant属性中:
def ant = new AntBuilder()
ant.sshexec(host: host,
port: port,
trust: true,
username: username,
password: password,
command: 'ls',
outputproperty: 'result')
def result = ant.project.properties.'result'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4681 次 |
| 最近记录: |