Merge pull request #45 from rodionovd/display-app-versions

Display app versions for installed and outdated apps
This commit is contained in:
Andrew Naylor 2016-09-17 18:19:31 +01:00 committed by GitHub
commit 96d6e5e415
3 changed files with 8 additions and 3 deletions

View file

@ -18,7 +18,7 @@ struct ListCommand: CommandType {
return .Success(())
}
for product in products {
print("\(product.itemIdentifier) \(product.appName)")
print("\(product.itemIdentifier) \(product.appName) (\(product.bundleVersion))")
}
return .Success(())
}

View file

@ -14,8 +14,13 @@ struct OutdatedCommand: CommandType {
func run(options: Options) -> Result<(), MASError> {
let updateController = CKUpdateController.sharedUpdateController()
let updates = updateController.availableUpdates()
let softwareMap = CKSoftwareMap.sharedSoftwareMap()
for update in updates {
print("\(update.itemIdentifier) \(update.title) (\(update.bundleVersion))")
if let installed = softwareMap.productForBundleIdentifier(update.bundleID) {
print("\(update.itemIdentifier) \(update.title) (\(installed.bundleVersion) -> \(update.bundleVersion))")
} else {
print("\(update.itemIdentifier) \(update.title) (unknown -> \(update.bundleVersion))")
}
}
return .Success(())
}

View file

@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
- (id)productForPath:(id)arg1;
- (NSArray<CKSoftwareProduct *>* __nullable)allProducts;
- (CKSoftwareProduct *)productForItemIdentifier:(unsigned long long)arg1;
- (CKSoftwareProduct *)productForBundleIdentifier:(NSString *)arg1;
- (nullable CKSoftwareProduct *)productForBundleIdentifier:(NSString *)arg1;
- (void)removeProductsObserver:(id)arg1;
//- (id)addProductsObserver:(CDUnknownBlockType)arg1 queue:(id)arg2;
- (id)initWithStoreClient:(id)arg1;