From 3668f3af9f56ab340fe7ea88b55f60383c5242cc Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Mon, 2 Aug 2021 13:41:52 +0530 Subject: [PATCH] build: Include 'swiftlint' location in the PATH before invoking it In macOS 11, HomeBrew installs swiftlint under /opt/homebrew, which is not in the default path that Xcode seems to use. So we include the PATH to contain: - /usr/local/bin: Where HomeBrew installs 'swiftlint' in macOS 10.15 and earlier - /opt/homebrew/bin: Where HomeBrew installs 'swiftlint' in macOS 11 Signed-off-by: Roopesh Chander --- WireGuard.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WireGuard.xcodeproj/project.pbxproj b/WireGuard.xcodeproj/project.pbxproj index c7f2958..8b19d16 100644 --- a/WireGuard.xcodeproj/project.pbxproj +++ b/WireGuard.xcodeproj/project.pbxproj @@ -1158,7 +1158,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; + shellScript = "export PATH=${PATH}:/usr/local/bin:/opt/homebrew/bin\nif which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; 5F45417B21C0906F00994C13 /* Swiftlint */ = { isa = PBXShellScriptBuildPhase; @@ -1176,7 +1176,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; + shellScript = "export PATH=${PATH}:/usr/local/bin:/opt/homebrew/bin\nif which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; 5F784E5721CDF6DD00B8D9A0 /* Strip Trailing Whitespace */ = { isa = PBXShellScriptBuildPhase; @@ -1212,7 +1212,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; + shellScript = "export PATH=${PATH}:/usr/local/bin:/opt/homebrew/bin\nif which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; 6FB1BDB821D4FA9100A991BF /* Strip Trailing Whitespace */ = { isa = PBXShellScriptBuildPhase; @@ -1248,7 +1248,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; + shellScript = "export PATH=${PATH}:/usr/local/bin:/opt/homebrew/bin\nif which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; /* End PBXShellScriptBuildPhase section */