如何从 $BUILD_LOG 变量中获取最后 20 行? [英] How can I take last 20 lines from the $BUILD_LOG variable?

查看:17
本文介绍了如何从 $BUILD_LOG 变量中获取最后 20 行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用 Email-ext 插件时,我还想在那里写下构建日志的最后 20 行(不作为文件附加)我知道我可以使用 $BUILD_LOG 变量访问日志,但不知道如何从该变量中获取 las 20 行.有什么帮助吗?非常感谢.

When using Email-ext plugin, I would like also to write the last 20 lines of the build log there (not attached as a file) I know I can access the log using $BUILD_LOG variable, but don't know exactly how to take the las 20 lines from that variable. Any help? Thanks a lot.

推荐答案

您可以使用来自 Content Token 参考的以下语法:

You could use the following syntax, from the Content Token reference:

${BUILD_LOG, maxLines, escapeHtml} - 显示构建日志的结尾.maxLines - 最多显示这么多行的日志.默认为 250.escapeHtml - 如果为 true,则 HTML 被转义.默认为假.

${BUILD_LOG, maxLines, escapeHtml} - Displays the end of the build log. maxLines - display at most this many lines of the log. Defaults to 250. escapeHtml - If true, HTML is escaped. Defaults to false.

这篇关于如何从 $BUILD_LOG 变量中获取最后 20 行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆