Skip to content

Commit

Permalink
Merge pull request #59 from ohaiibuzzle/fix/gptk-b4
Browse files Browse the repository at this point in the history
fix: path for gptk b4
  • Loading branch information
ohaiibuzzle authored Aug 23, 2023
2 parents e929131 + dc29a93 commit 50d9d06
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Harbor/Systems/GPKUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,21 @@ final class GPKUtils {
return
}
let gpkVolume = URL(fileURLWithPath: "/Volumes/\(mountedVolume)")
let gpkLib = gpkVolume.appendingPathComponent("lib")

let gpkLib: URL
// Check if the directory `redist/` exist
if FileManager.default.fileExists(atPath: gpkVolume.appendingPathComponent("redist").path) {
gpkLib = gpkVolume.appendingPathComponent("redist").appendingPathComponent("lib")
} else {
gpkLib = gpkVolume.appendingPathComponent("lib")
}

let gpkLibDest = URL(fileURLWithPath: "/usr/local/opt/game-porting-toolkit/lib")

// Merge the content from /Volumes/Game Porting Toolkit*/lib to /usr/local/opt/game-porting-toolkit/lib
let dittoProcess = Process()
dittoProcess.executableURL = URL(fileURLWithPath: "/usr/bin/ditto")
dittoProcess.arguments = ["-V", gpkLib.path, gpkLibDest.path]
dittoProcess.standardOutput = nil
dittoProcess.standardError = nil
do {
try dittoProcess.run()
} catch {
Expand Down

0 comments on commit 50d9d06

Please sign in to comment.