Skip to content

Commit

Permalink
Check user defaults before starting MenuHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
jakob committed Oct 27, 2016
1 parent 368bc8a commit 386cc2d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions PostgresLoginHelper/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ if Bundle.main.bundlePath.hasPrefix("/Applications/Postgres.app") {
serverManager.startServers()

// launch PostgresMenuHelper
let menuHelperAppURL = URL(fileURLWithPath: "/Applications/Postgres.app/Contents/MacOS/PostgresMenuHelper.app")
if !NSWorkspace.shared().open(menuHelperAppURL) {
print("Failed to launch MenuHelperApp")
if UserDefaults.shared.bool(forKey: "HideMenuHelperApp") == false {
let menuHelperAppURL = URL(fileURLWithPath: "/Applications/Postgres.app/Contents/MacOS/PostgresMenuHelper.app")
if !NSWorkspace.shared().open(menuHelperAppURL) {
print("Failed to launch MenuHelperApp")
}
}
}

0 comments on commit 386cc2d

Please sign in to comment.