mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 03:50:08 +02:00
🐛 Fix concurrency crashes with @objc methods
This commit is contained in:
@ -33,8 +33,8 @@ class Application {
|
||||
Attempt to open a specific directory in the app of choice.
|
||||
(This will open the app if it isn't open yet.)
|
||||
*/
|
||||
@objc public func openDirectory(file: String) async {
|
||||
return await Shell.quiet("/usr/bin/open -a \"\(name)\" \"\(file)\"")
|
||||
@objc public func openDirectory(file: String) {
|
||||
Task { await Shell.quiet("/usr/bin/open -a \"\(name)\" \"\(file)\"") }
|
||||
}
|
||||
|
||||
/** Checks if the app is installed. */
|
||||
|
@ -30,17 +30,17 @@ extension DomainListVC {
|
||||
NSWorkspace.shared.open(url)
|
||||
}
|
||||
|
||||
@objc func openInFinder() async {
|
||||
await Shell.quiet("open '\(selectedSite!.absolutePath)'")
|
||||
@objc func openInFinder() {
|
||||
Task { return await Shell.quiet("open '\(selectedSite!.absolutePath)'") }
|
||||
}
|
||||
|
||||
@objc func openInTerminal() async {
|
||||
await Shell.quiet("open -b com.apple.terminal '\(selectedSite!.absolutePath)'")
|
||||
@objc func openInTerminal() {
|
||||
Task { await Shell.quiet("open -b com.apple.terminal '\(selectedSite!.absolutePath)'") }
|
||||
}
|
||||
|
||||
@objc func openWithEditor(sender: EditorMenuItem) async {
|
||||
@objc func openWithEditor(sender: EditorMenuItem) {
|
||||
guard let editor = sender.editor else { return }
|
||||
await editor.openDirectory(file: selectedSite!.absolutePath)
|
||||
editor.openDirectory(file: selectedSite!.absolutePath)
|
||||
}
|
||||
|
||||
// MARK: - UI interaction
|
||||
|
Reference in New Issue
Block a user