Skip to content

Commit 697f84c

Browse files
committed
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
1 parent 19d38c6 commit 697f84c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/swift-bundler/Bundler/XcodeSupportGenerator.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@ enum XcodeSupportGenerator {
107107
let packagePath = "${WORKSPACE_PATH}/../../../"
108108

109109
// Commands to put in the scheme
110+
let fixPath = "export PATH=`zsh --login -c '[ -f /etc/zshrc ] && . /etc/zshrc; [ -f ~/.zshrc ] && . ~/.zshrc; echo $PATH'`"
110111
let command = "swift-bundler bundle"
111112
let arguments = "\(app) -d \(packagePath) --products-directory ${BUILT_PRODUCTS_DIR} -o '\(escapedOutputPath)' --skip-build --built-with-xcode"
112-
let createBundle = "\(command) \(arguments)"
113+
let createBundle = "\(fixPath); \(command) \(arguments)"
114+
.replacingOccurrences(of: "&", with: "&")
113115

114116
// Create the scheme's contents from a massive template
115117
return .success("""

0 commit comments

Comments
 (0)