Skip to content

Commit

Permalink
tweak exec process launching further
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilken committed Feb 1, 2024
1 parent 7a4f2e6 commit 2609474
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Nautik Helper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0.3;
MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = io.nautik.Nautik.Helper;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -370,7 +370,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0.3;
MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = io.nautik.Nautik.Helper;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
4 changes: 2 additions & 2 deletions Nautik Helper/StoredCluster.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ func executeCommand(command: String, arguments: [String]? = nil) throws -> Strin
throw "Couldn't evaluate the user's SHELL."
}

guard let cmdPath = try runProcess(command: "/usr/bin/env", arguments: [shell, "-cl\(shell.contains("zsh") ? "i" : "")", "which \(command)"]) else {
guard let cmdPath = try runProcess(command: shell, arguments: ["-cl\(shell.contains("zsh") ? "i" : "")", "which \(command)"]) else {
throw "Executable \(command) not found in the user's PATH."
}
if cmdPath == "\(command) not found" {
throw "Executable \(command) not found in the user's PATH."
}

let stdout = try runProcess(command: "/usr/bin/env", arguments: [shell, "-cl\(shell.contains("zsh") ? "i" : "")", "\(cmdPath) \(arguments.map { $0.joined(separator: " ") } ?? "")"])
let stdout = try runProcess(command: shell, arguments: ["-cl\(shell.contains("zsh") ? "i" : "")", "\(cmdPath) \(arguments.map { $0.joined(separator: " ") } ?? "")"])

return stdout

Expand Down

0 comments on commit 2609474

Please sign in to comment.