mirror of
https://github.com/xtool-org/xtool.git
synced 2026-02-04 11:53:30 +01:00
* Package xtool as a .app on macOS * Need hardened runtime for notarization * Rename product to xtool.app
25 lines
691 B
Swift
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()
|
|
}
|
|
}
|
|
}
|