如何限制“运行脚本”我的发布配置的构建阶段?

发布于 2024-09-17 20:05:21 字数 95 浏览 6 评论 0原文

我有一个 shell 脚本,我想在目标构建阶段结束时运行它。但是,我希望此脚本仅在使用 release 配置构建时运行。这怎么能做到呢?谢谢!

I have a shell script that I would like to run at the end of my target's build phase. However, I would like this script to only run when I build with the release configuration. How can this be done? Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甜嗑 2024-09-24 20:05:21
if [ "${CONFIGURATION}" = "Release" ]; then
  echo Do something really release-like
fi

该脚本将在每个配置结束时运行,但在这种情况下它不会执行任何操作,除非配置是发布(假设它执行的所有操作都包含在测试块中)。

if [ "${CONFIGURATION}" = "Release" ]; then
  echo Do something really release-like
fi

The script will run at the end of every configuration, but it won't do anything in this case unless the configuration is Release (assuming everything it does is contained within the test block).

心碎的声音 2024-09-24 20:05:21

最简单的方法是选中“仅在安装时运行脚本”复选框。
< /a>

The easiest way to do this, is checking the "Run script only when installing" checkbox.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文