【问题标题】:Swiftlint can't be found on Apple Silicon xcode在 Apple Silicon xcode 上找不到 Swiftlint
【发布时间】:2021-05-05 13:24:59
【问题描述】:

使用自制软件安装swiftlint 时,一切都正确安装,但是当我打开 xcode 时,我看到未安装 swiftlint 的消息。我读了这个issue,它说现在/opt/homebrew用苹果硅和xcode在/usr/local中寻找swiftlint?我怎样才能让 xcode 重新确认我实际上已经安装了 swiftlint。 Swiftlint 肯定已安装,我可以从终端输入 swiftlint 并查看所有命令。

【问题讨论】:

  • 你发现了吗?我有同样的问题。

标签: xcode swiftlint apple-silicon


【解决方案1】:

我无法找到如何永久修改 Xcode 构建阶段脚本的 $PATH 变量。此脚本将在运行期间将 Apple Silicon homebrew 路径添加到您的脚本 PATH 中。我已经在 M1 和 Intel Mac 上对此进行了测试,并且两者都适用。

# Adds support for Apple Silicon brew directory
export PATH="$PATH:/opt/homebrew/bin"

if which swiftlint; then
    swiftlint autocorrect && swiftlint
else
  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

【讨论】:

    猜你喜欢
    • 2020-11-11
    • 2021-05-05
    • 2021-09-06
    • 2021-05-15
    • 1970-01-01
    • 2020-05-06
    • 2021-08-10
    • 1970-01-01
    • 2021-08-20
    相关资源
    最近更新 更多