Skip to content

Commit 7fd501c

Browse files
committed
Now displays download size
1 parent b1c821d commit 7fd501c

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

FetchInstallerPkg.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@
373373
CODE_SIGN_IDENTITY = "Apple Development";
374374
CODE_SIGN_STYLE = Automatic;
375375
COMBINE_HIDPI_IMAGES = YES;
376-
CURRENT_PROJECT_VERSION = 18;
376+
CURRENT_PROJECT_VERSION = 21;
377377
DEVELOPMENT_ASSET_PATHS = "\"FetchInstallerPkg/Preview Content\"";
378378
DEVELOPMENT_TEAM = JME5BW3F3R;
379379
ENABLE_APP_SANDBOX = YES;
@@ -409,7 +409,7 @@
409409
CODE_SIGN_IDENTITY = "Apple Development";
410410
CODE_SIGN_STYLE = Automatic;
411411
COMBINE_HIDPI_IMAGES = YES;
412-
CURRENT_PROJECT_VERSION = 18;
412+
CURRENT_PROJECT_VERSION = 21;
413413
DEVELOPMENT_ASSET_PATHS = "\"FetchInstallerPkg/Preview Content\"";
414414
DEVELOPMENT_TEAM = JME5BW3F3R;
415415
ENABLE_APP_SANDBOX = YES;

FetchInstallerPkg/Model/Product.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,20 @@ class Product: Codable, Identifiable, ObservableObject {
5050
return buildManifest?.url
5151
}
5252

53+
var installerPackage: Package? {
54+
return packages.first { $0.url.hasSuffix("InstallAssistant.pkg")}
55+
}
56+
5357
var installAssistantURL: URL? {
54-
if let installAssistant = packages.first(where: { $0.url.hasSuffix("InstallAssistant.pkg")}) {
58+
if let installAssistant = self.installerPackage {
5559
return URL(string: installAssistant.url)
5660
} else {
5761
return nil
5862
}
59-
63+
}
64+
65+
var installAssistantSize: Int {
66+
return self.installerPackage?.size ?? 0
6067
}
6168

6269
func loadBuildManifest() {

FetchInstallerPkg/Prefs.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ struct Prefs {
4141
let downloadURL = URL(fileURLWithPath: self.downloadPath)
4242
return downloadURL
4343
}
44+
45+
static let byteFormatter = ByteCountFormatter()
4446
}

FetchInstallerPkg/View/DownloadView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct DownloadView: View {
3838
Button(action: {
3939
downloadManager.revealInFinder()
4040
}) {
41-
Image(systemName: "magnifyingglass.circle")
41+
Image(systemName: "magnifyingglass")
4242
Text("Show in Finder")
4343
}
4444
}

FetchInstallerPkg/View/InstallerView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ struct InstallerView: View {
3232
HStack {
3333
Text(product.postDate, style: .date)
3434
.font(.footnote)
35+
Text(Prefs.byteFormatter.string(fromByteCount: Int64(product.installAssistantSize)))
36+
.font(.footnote)
3537
Spacer()
3638
Text(product.buildVersion ?? "<no build>")
3739
.frame(alignment: .trailing)

0 commit comments

Comments
 (0)