Skip to content

Commit

Permalink
Quick fixes before v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
milanvarady committed Sep 16, 2023
1 parent 2769cfe commit 30eb4a5
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 41 deletions.
4 changes: 2 additions & 2 deletions Applite.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.2;
PRODUCT_BUNDLE_IDENTIFIER = dev.aerolite.Applite;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -705,7 +705,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.2;
PRODUCT_BUNDLE_IDENTIFIER = dev.aerolite.Applite;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
4 changes: 2 additions & 2 deletions Applite/Model/Cask Data/Cask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,15 @@ final class Cask: Identifiable, Decodable, Hashable, ObservableObject {
}
}

appPath = "\(applicationsDirectory)/\(self.name).app"
appPath = "\"\(applicationsDirectory)/\(self.name).app\""
} else {
// Open normal app
let brewDirectory = BrewPaths.currentBrewDirectory

appPath = "\(brewDirectory.replacingOccurrences(of: " ", with: "\\ ") )/Caskroom/\(self.id)/*/*.app"
}

let result = shell("open \"\(appPath)\"")
let result = shell("open \(appPath)")

if result.didFail {
Self.logger.error("Couldn't launch app at path: \(appPath). Output: \(result.output)")
Expand Down
63 changes: 30 additions & 33 deletions Applite/Views/Detail Views/BrewManagementView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,36 @@ struct BrewManagementView: View {

var body: some View {
ScrollView {
VStack(alignment: .leading) {
// Title
Text("Manage Homebrew")
.font(.system(size: 32, weight: .bold))

Text("This application uses the [Homebrew](https://brew.sh/) (brew for short) package manager to download apps. Homebrew is a free and open source command line utility that can download useful developer tools as well as desktop applications.")
VStack {
VStack(alignment: .leading) {
// Title
Text("Manage Homebrew")
.font(.system(size: 32, weight: .bold))

Text("This application uses the [Homebrew](https://brew.sh/) (brew for short) package manager to download apps. Homebrew is a free and open source command line utility that can download useful developer tools as well as desktop applications.")
.padding(.bottom)

section(title: "Info") {
InfoView()
}
.padding(.bottom)

section(title: "Info") {
InfoView()
}
.padding(.bottom)

section(title: "Actions") {
ActionsView(modifyingBrew: $modifyingBrew)
}
.padding(.bottom)

section(title: "Import/Export apps") {
ExportView()

section(title: "Actions") {
ActionsView(modifyingBrew: $modifyingBrew)
}
.padding(.bottom)

section(title: "Import/Export apps") {
ExportView()
}

Spacer()
}

Spacer()
.frame(maxWidth: 800)
.padding(12)
}
.padding(12)
.frame(maxWidth: .infinity)
}
.frame(maxWidth: 800)
}

func section<Content: View>(title: LocalizedStringKey, @ViewBuilder content: ()->Content) -> some View {
Expand Down Expand Up @@ -151,6 +154,10 @@ struct BrewManagementView: View {
// Reinstall brew button
HStack {
reinstallButton
.task {
// Check if brew is installed in application support
isAppBrewInstalled = isBrewPathValid(path: BrewPaths.getBrewExectuablePath(for: .appPath))
}

if reinstallDone {
Image(systemName: "checkmark")
Expand All @@ -172,14 +179,6 @@ struct BrewManagementView: View {
SmallProgressView()
}
}

EmptyView()
.task {
// Check if brew is installed in application support
print("checking \(BrewPaths.getBrewExectuablePath(for: .appPath))")
isAppBrewInstalled = isBrewPathValid(path: BrewPaths.getBrewExectuablePath(for: .appPath))
print("result \(isAppBrewInstalled)")
}
}

private var updateButton: some View {
Expand Down Expand Up @@ -328,8 +327,6 @@ struct BrewManagementView: View {
do {
let casks = try readCaskFile(url: url[0])

print(casks)

installImported(casks: casks)
} catch {
logger.error("Failed to import cask. Reason: \(error.localizedDescription)")
Expand Down
4 changes: 2 additions & 2 deletions Applite/Views/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ fileprivate struct GeneralSettingsView: View {
// Set color scheme to system
colorSchemePreference = darkMode ? .dark : .light
// Wait
try? await Task.sleep(for: .seconds(0.001))
try? await Task.sleep(for: .seconds(0.1))
// Set it back to nil (.system)
colorSchemePreference = .system
// Wait
try? await Task.sleep(for: .seconds(0.001))
try? await Task.sleep(for: .seconds(0.1))
// Set fixing color back to false
await MainActor.run { self.fixingColor = false }
}
Expand Down
2 changes: 1 addition & 1 deletion Applite/Views/SetupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ struct SetupView: View {

VStack(alignment: .leading) {
BrewPathSelectorView(isSelectedPathValid: $isBrewPathValid)
.padding(.bottom)

Text("Selected brew path is invalid!")
.foregroundColor(.red)
.opacity(isBrewPathValid ? 0 : 1)
.padding(.bottom)

Text("Appdir (optional)")
.font(.system(size: 16, weight: .bold))
Expand Down
2 changes: 1 addition & 1 deletion Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@
"hu" : {
"stringUnit" : {
"state" : "translated",
"value" : "Függőségek telepítése"
"value" : "Tartozékok telepítése"
}
}
}
Expand Down

0 comments on commit 30eb4a5

Please sign in to comment.