diff --git a/.gitignore b/.gitignore index 8227e627e..56d9d45a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,99 +1,34 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser +*.hmap +*.ipa *.mode1v3 -!default.mode1v3 *.mode2v3 -!default.mode2v3 +*.moved-aside +*.pbxuser *.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other +*.xcarchive *.xccheckout -*.moved-aside -*.xcuserstate *.xcscmblueprint -*.xcarchive - -## Obj-C/Swift specific -*.hmap -*.ipa - -# Bundler -/.rubygems/ -/bin/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control -# -Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# CocoaSeeds -!Seeds/Seedfile.lock -Seeds/**/.git* -Seeds/**/.swift-version -Seeds/**/.travis.yml -Seeds/**/*.md -Seeds/**/Cartfile* -Seeds/**/Carthage/ -Seeds/**/LICENSE* -Seeds/**/Package.* -Seeds/**/*Info.plist -Seeds/**/*.podspec -Seeds/**/*.xc* -Seeds/**/Tests/ -# Commandant -!Seeds/Commandant/Source/*.swift -# Result -!Seeds/Result/Result/*.swift -Seeds/Quick -Seeds/Nimble - -## https://github.com/github/gitignore/blob/master/Global/OSX.gitignore -.DS_Store +*.xcuserstate +*.zip +.AppleDB +.AppleDesktop .AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume +.DS_Store .DocumentRevisions-V100 -.fseventsd +.LSOverride .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items +._* .apdisk - -# Build artifacts -*.zip +.envrc +.fseventsd +.rubygems/ +Carthage/Build +DerivedData +Pods/ +Temporary Items +bin/ +build/ +xcuserdata diff --git a/App/AppStore/ISStoreAccount.swift b/App/AppStore/ISStoreAccount.swift index 7bf9a28c7..57f513e25 100644 --- a/App/AppStore/ISStoreAccount.swift +++ b/App/AppStore/ISStoreAccount.swift @@ -12,7 +12,26 @@ extension ISStoreAccount { } static var primaryAccount: ISStoreAccount? { - return CKAccountStore.shared().primaryAccount + var account: ISStoreAccount? + + if #available(macOS 10.13, *) { + let group = DispatchGroup() + group.enter() + + let accountService: ISAccountService = ISServiceProxy.genericShared().accountService + accountService.primaryAccount { (storeAccount: ISStoreAccount) in + account = storeAccount + group.leave() + } + + _ = group.wait(timeout: .now() + 30) + } else { + // macOS 10.9-10.12 + let accountStore = CKAccountStore.shared() + account = accountStore.primaryAccount + } + + return account } static func signIn(username: String, password: String, systemDialog: Bool = false) throws -> ISStoreAccount { diff --git a/App/MASError.swift b/App/MASError.swift index 5db9624d8..840e8c66d 100644 --- a/App/MASError.swift +++ b/App/MASError.swift @@ -29,8 +29,9 @@ enum MASError: Error, CustomStringConvertible { case .signInDisabled: return "The 'signin' command has been disabled on this macOS version. " + + "Please sign into the Mac App Store app manually." + "\nFor more info see: " + - "https://github.com/mas-cli/mas/pull/162" + "https://github.com/mas-cli/mas/issues/164" case .signInFailed(let error): if let error = error { diff --git a/App/mas-cli-Info.plist b/App/mas-cli-Info.plist index 2241efe18..6a348b273 100644 --- a/App/mas-cli-Info.plist +++ b/App/mas-cli-Info.plist @@ -11,6 +11,6 @@ CFBundleName mas-cli CFBundleShortVersionString - 1.4.1 + 1.4.2 diff --git a/AppTests/Info.plist b/AppTests/Info.plist index 694898d7c..2fab5c7d4 100644 --- a/AppTests/Info.plist +++ b/AppTests/Info.plist @@ -15,8 +15,8 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.4.1 + 1.4.2 CFBundleVersion - 10401000 + 10402000 diff --git a/CHANGELOG.md b/CHANGELOG.md index 84b05ac58..40b7518c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,14 +7,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -- ⛔ Disable `signin` command on macOS 10.13+ #162 -- 🐛 Fix `signout` command #162 + + +## [v1.4.2] - 2018-08-12 + +- 🚏📥🙅🏻‍♀️ Disabled `signin` command on macOS 10.13+ #162 + - An error is immediately returned instead of crashing on newer macOS versions. + - See #164 for updates on this issue. +- 🐛 Fixed `signout` command #162 +- 🐛 Fixed `account` command #165 +- ✨ Added price to `search` command when `--price` flag specified #62, #148 +- 🎨 `search` output is now formatted in columns #148 - ➖ CocoaSeeds #155 - ➕🍫 CocoaPods (1.5.3) #155 - 🛠 Xcode 9.4 #153 - 🛠 Xcode 9.3 #141 -- 👷🏻‍♀️⚠️ Re-enable Danger #137 -- ✨ Add price to `search` command #62 +- 👷🏻‍♀️⚠️ Re-enabled Danger #137 ## [v1.4.1] Stop Littering - 2018-02-18 @@ -98,7 +106,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [v1.0.0] - 2015-09-20 - Initial Release -[Unreleased]: https://github.com/mas-cli/mas/compare/v1.4.1...HEAD +[Unreleased]: https://github.com/mas-cli/mas/compare/v1.4.2...HEAD +[v1.4.2]: https://github.com/mas-cli/mas/compare/v1.4.1...v1.4.2 [v1.4.1]: https://github.com/mas-cli/mas/compare/v1.4.0...v1.4.1 [v1.4.0]: https://github.com/mas-cli/mas/compare/v1.3.1...v1.4.0 [v1.3.1]: https://github.com/mas-cli/mas/compare/v1.3.0...v1.3.1 diff --git a/README.md b/README.md index 150bb387d..b3e1aea99 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@ applications and their product identifiers. 497799835 Xcode It is possible to search for applications by name using `mas search` which -will search the Mac App Store and return matching identifiers +will search the Mac App Store and return matching identifiers. +Include the `--price` flag to include prices in the result. $ mas search Xcode 497799835 Xcode @@ -41,7 +42,14 @@ application identifier: ==> Downloading PaintCode 2 ==> Installed PaintCode 2 -> Please note that this command will not allow you to install (or even purchase) an app for the first time: it must already be in the Purchased tab of the App Store. +If you want to install the first result that the `search` command returns, use the `lucky` command. + + $ mas lucky twitter + ==> Downloading Twitter + ==> Installed Twitter + +> Please note that this command will not allow you to install (or even purchase) an app for the first time: +it must already be in the Purchased tab of the App Store. Use `mas outdated` to list all applications with pending updates. @@ -49,13 +57,9 @@ Use `mas outdated` to list all applications with pending updates. 497799835 Xcode (7.0) 446107677 Screens VNC - Access Your Computer From Anywhere (3.6.7) - If you want to install the first result that the `search` command would prompt you: - - $ mas lucky twitter - ==> Downloading Twitter - ==> Installed Twitter - -> `mas` is only able to install/update applications that are listed in the Mac App Store itself. Use [`softwareupdate(8)`](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man8/softwareupdate.8.html) utility for downloading system updates (like iTunes, Xcode Command Line Tools, etc) +> `mas` is only able to install/update applications that are listed in the Mac App Store itself. +Use [`softwareupdate(8)`](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man8/softwareupdate.8.html) +utility for downloading system updates (like iTunes, Xcode Command Line Tools, etc) To install all pending updates run `mas upgrade`. @@ -76,16 +80,22 @@ Updates can be performed selectively by providing the app identifier(s) to ==> Downloading Xcode ==> Installed Xcode +### Signin + To sign into the Mac App Store for the first time run `mas signin`. $ mas signin mas@example.com ==> Signing in to Apple ID: mas@example.com Password: +> ⚠️ Due to breaking changes in the underlying API that mas uses to interact with the Mac App Store, +> the `signin` command has been temporarily disabled on macOS 10.13+ ⛔. +> For more information on this issue, see [#164](https://github.com/mas-cli/mas/issues/164). + If you experience issues signing in this way, you can ask to signin using a graphical dialog (provided by Mac App Store application): -> -> $ mas signin --dialog mas@example.com -> ==> Signing in to Apple ID: mas@example.com + + $ mas signin --dialog mas@example.com + ==> Signing in to Apple ID: mas@example.com You can also embed your password in the command. @@ -96,7 +106,9 @@ Use `mas signout` to sign out from the Mac App Store. ## Homebrew integration -`mas` is integrated with [homebrew-bundle](https://github.com/Homebrew/homebrew-bundle). If `mas` is installed, and you run `brew bundle dump`, then your Mac App Store apps will be included in the Brewfile created. See the [homebrew-bundle](https://github.com/Homebrew/homebrew-bundle) docs for more details. +`mas` is integrated with [homebrew-bundle](https://github.com/Homebrew/homebrew-bundle). If `mas` is installed, and you run `brew bundle dump`, +then your Mac App Store apps will be included in the Brewfile created. See the [homebrew-bundle](https://github.com/Homebrew/homebrew-bundle) +docs for more details. ## When something doesn't work diff --git a/mas-cli.xcodeproj/project.pbxproj b/mas-cli.xcodeproj/project.pbxproj index 448d1ac71..e239b5188 100644 --- a/mas-cli.xcodeproj/project.pbxproj +++ b/mas-cli.xcodeproj/project.pbxproj @@ -504,7 +504,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CREATE_INFOPLIST_SECTION_IN_BINARY = YES; - CURRENT_PROJECT_VERSION = 10401000; + CURRENT_PROJECT_VERSION = 10402000; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -570,7 +570,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CREATE_INFOPLIST_SECTION_IN_BINARY = YES; - CURRENT_PROJECT_VERSION = 10401000; + CURRENT_PROJECT_VERSION = 10402000; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; diff --git a/script/build b/script/build index 010638d62..ab0c674fd 100755 --- a/script/build +++ b/script/build @@ -16,9 +16,10 @@ main() { build # If this is a tagged build we are going to release - if [[ ! -z $TRAVIS_TAG ]]; then +# TEMP: Generate archive on all builds +# if [[ ! -z $TRAVIS_TAG ]]; then archive - fi +# fi } build() { diff --git a/script/package b/script/package index b6a9973f4..bc510fcec 100755 --- a/script/package +++ b/script/package @@ -13,7 +13,7 @@ echo "==> 🗜️ Compressing mas.xcarchive" zip -r mas.xcarchive.zip mas.xcarchive echo "==> ️🗜️ Compressing binary" -zip -j mas-cli.zip mas.xcarchive/Products/usr/local/bin/mas +zip -j mas-cli.zip mas.xcarchive/Products/build/mas echo -n "==> 🔢 SHA256: " shasum -a 256 mas-cli.zip