在Xcode中切换运行脚本构建阶段

问题描述 投票:6回答:1

我有一个运行脚本构建阶段,我已添加到Xcode项目中。

我希望能够在我希望它运行时切换此运行脚本,在我不运行时关闭。

在Xcode中这是可能的吗?如果可以的话怎么办呢?

ios xcode ios8 xcode6 run-script
1个回答
1
投票

我曾经在第一行写exit来切换脚本和#exit来切换,就像这样:

关闭脚本,例如SwiftLint:

exit
if which swiftlint >/dev/null; then
  swiftlint
else
  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

打开:

#exit
if which swiftlint >/dev/null; then
  swiftlint
else
  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

您只需要修改1个字符,无论退出是否已注释掉。

© www.soinside.com 2019 - 2024. All rights reserved.