Skip to content

Commit

Permalink
Store terminal value in user defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
onmyway133 committed Sep 14, 2018
1 parent 8dac33b commit 4445d4a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion FinderGo/AppWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ struct AppWorker {
return script?.executeAndReturnError(nil).stringValue
}

func findTerminal() -> String {
return UserDefaults.standard.string(forKey: "terminal") ?? "iTerm"
}

func run() {
guard let path = finderCurrentPath() else {
return
}

let process = Process()
let terminal = findTerminal()
process.launchPath = "/usr/bin/open"
process.arguments = ["-a", "iTerm", "\(path)"]
process.arguments = ["-a", terminal, "\(path)"]

process.launch()
process.waitUntilExit()
Expand Down

0 comments on commit 4445d4a

Please sign in to comment.