Skip to content

Commit

Permalink
fix: swift compiler building debug fine but tweakin over prod
Browse files Browse the repository at this point in the history
aw hell naw yo ass tweakin jigsaw
0.2.0-alpha real
  • Loading branch information
vapidinfinity committed Jun 18, 2024
1 parent 4089464 commit 7400de5
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions Mythic/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,25 @@ class AppDelegate: NSObject, NSApplicationDelegate { // https://arc.net/l/quote/
alert.addButton(withTitle: "Move")
alert.addButton(withTitle: "Cancel")

if let window = NSApp.windows.first,
let optimalAppURL = optimalAppURL,
case .alertFirstButtonReturn = alert.beginSheetModal(for: window) {
do {
_ = try files.replaceItemAt(optimalAppURL, withItemAt: currentAppURL)
workspace.open(optimalAppURL)
} catch {
Logger.file.error("Unable to move Mythic to Applications: \(error)")

let error = NSAlert()
error.messageText = "Unable to move Mythic to \"\(optimalAppURL.deletingLastPathComponent().prettyPath())\"."
error.addButton(withTitle: "Quit")

if error.runModal() == .alertFirstButtonReturn {
exit(1)
if let window = NSApp.windows.first, let optimalAppURL = optimalAppURL {
alert.beginSheetModal(for: window) { response in
if case .alertFirstButtonReturn = response {
do {
_ = try files.replaceItemAt(optimalAppURL, withItemAt: currentAppURL)
workspace.open(optimalAppURL)
} catch {
Logger.file.error("Unable to move Mythic to Applications: \(error)")

let error = NSAlert()
error.messageText = "Unable to move Mythic to \"\(optimalAppURL.deletingLastPathComponent().prettyPath())\"."
error.addButton(withTitle: "Quit")

error.beginSheetModal(for: window) { response in
if case .alertFirstButtonReturn = response {
exit(1)
}
}
}
}
}
}
Expand Down

0 comments on commit 7400de5

Please sign in to comment.