From 697f84cc038407f7c6b84b07105af1c3ee0d08be Mon Sep 17 00:00:00 2001 From: stackotter Date: Mon, 25 Apr 2022 08:33:47 +1000 Subject: [PATCH] Fix Xcode not finding swift-bundler on the path We now add a line to the scheme which fetches the PATH as it would be in the user's terminal so the Xcode can always find swift-bundler --- Sources/swift-bundler/Bundler/XcodeSupportGenerator.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/swift-bundler/Bundler/XcodeSupportGenerator.swift b/Sources/swift-bundler/Bundler/XcodeSupportGenerator.swift index 46e56aca..c5855f86 100644 --- a/Sources/swift-bundler/Bundler/XcodeSupportGenerator.swift +++ b/Sources/swift-bundler/Bundler/XcodeSupportGenerator.swift @@ -107,9 +107,11 @@ enum XcodeSupportGenerator { let packagePath = "${WORKSPACE_PATH}/../../../" // Commands to put in the scheme + let fixPath = "export PATH=`zsh --login -c '[ -f /etc/zshrc ] && . /etc/zshrc; [ -f ~/.zshrc ] && . ~/.zshrc; echo $PATH'`" let command = "swift-bundler bundle" let arguments = "\(app) -d \(packagePath) --products-directory ${BUILT_PRODUCTS_DIR} -o '\(escapedOutputPath)' --skip-build --built-with-xcode" - let createBundle = "\(command) \(arguments)" + let createBundle = "\(fixPath); \(command) \(arguments)" + .replacingOccurrences(of: "&", with: "&") // Create the scheme's contents from a massive template return .success("""