mirror of
https://github.com/mas-cli/mas
synced 2024-11-26 05:20:18 +00:00
⛔ Disable signin command on macOS 10.13 and greater
This commit is contained in:
parent
912fcb7925
commit
d156e737d8
2 changed files with 28 additions and 18 deletions
|
@ -16,6 +16,10 @@ struct SignInCommand: CommandProtocol {
|
|||
|
||||
func run(_ options: Options) -> Result<(), MASError> {
|
||||
|
||||
if #available(macOS 10.13, *) {
|
||||
return .failure(.signInDisabled)
|
||||
}
|
||||
|
||||
guard ISStoreAccount.primaryAccount == nil else {
|
||||
return .failure(.alreadySignedIn)
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import Foundation
|
|||
|
||||
enum MASError: Error, CustomStringConvertible {
|
||||
case notSignedIn
|
||||
case signInDisabled
|
||||
case signInFailed(error: NSError?)
|
||||
case alreadySignedIn
|
||||
|
||||
|
@ -26,6 +27,11 @@ enum MASError: Error, CustomStringConvertible {
|
|||
case .notSignedIn:
|
||||
return "Not signed in"
|
||||
|
||||
case .signInDisabled:
|
||||
return "The 'signin' command has been disabled on this macOS version. " +
|
||||
"\nFor more info see: " +
|
||||
"https://github.com/mas-cli/mas/issues/107"
|
||||
|
||||
case .signInFailed(let error):
|
||||
if let error = error {
|
||||
return "Sign in failed: \(error.localizedDescription)"
|
||||
|
|
Loading…
Reference in a new issue