Files
xtool-mirror/macOS/XToolMac/XToolMac.swift
Kabir Oberai 51cab9a32e Package xtool as a .app on macOS (#12)
* Package xtool as a .app on macOS

* Need hardened runtime for notarization

* Rename product to xtool.app
2025-05-10 15:15:31 +05:30

25 lines
691 B
Swift

import Foundation
import Dependencies
import XToolSupport
import XKit
@main enum XToolMacMain {
static func main() async throws {
// the bin/xtool script invokes us with this env var, allowing us to
// detect command-line invocations vs a UI app launch
if ProcessInfo.processInfo.environment["XTL_CLI"] == "1" {
try await runXTool()
} else {
XToolMacUI.main()
}
}
private static func runXTool() async throws {
try await withDependencies {
$0.keyValueStorage = KeychainStorage(service: "sh.xtool.keychain.credentials")
} operation: {
try await XTool.run()
}
}
}