Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 22 additions & 87 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
21 changes: 20 additions & 1 deletion App/AppStore/ISStoreAccount.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion App/MASError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion App/mas-cli-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<key>CFBundleName</key>
<string>mas-cli</string>
<key>CFBundleShortVersionString</key>
<string>1.4.1</string>
<string>1.4.2</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions AppTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.1</string>
<string>1.4.2</string>
<key>CFBundleVersion</key>
<string>10401000</string>
<string>10402000</string>
</dict>
</plist>
19 changes: 14 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
38 changes: 25 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,21 +42,24 @@ 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.

$ mas outdated
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`.

Expand All @@ -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.

Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions mas-cli.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions script/build
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion script/package
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down