Skip to content

Commit

Permalink
Fix Xcode not finding swift-bundler on the path
Browse files Browse the repository at this point in the history
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
  • Loading branch information
stackotter committed Apr 24, 2022
1 parent 19d38c6 commit 697f84c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/swift-bundler/Bundler/XcodeSupportGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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("""
Expand Down

0 comments on commit 697f84c

Please sign in to comment.