Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Bundle ID #152

Merged
merged 2 commits into from
Jun 21, 2023
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
2 changes: 1 addition & 1 deletion Whisky.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@
isa = PBXGroup;
children = (
EEA5A2452A31DD65008274AE /* AppDelegate.swift */,
6E26058729D927F900DDD788 /* Extensions */,
6E5197CF29D71FF900CF655E /* Models */,
6E5197D029D7200700CF655E /* Utils */,
6E5197CE29D71FE800CF655E /* View Models */,
6E26058729D927F900DDD788 /* Extensions */,
6E5197CD29D71FCD00CF655E /* Views */,
6E40495929CCA19C006E3F1B /* Assets.xcassets */,
6E899D1129CFC41D00A4A083 /* Info.plist */,
Expand Down
2 changes: 1 addition & 1 deletion Whisky/Extensions/URLExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extension URL {
func prettyPath() -> String {
var prettyPath = path
prettyPath = prettyPath
.replacingOccurrences(of: "com.isaacmarovitz.Whisky", with: "Whisky")
.replacingOccurrences(of: Bundle.main.bundleIdentifier ?? "com.isaacmarovitz.Whisky", with: "Whisky")
.replacingOccurrences(of: "/Users/\(NSUserName())", with: "~")
return prettyPath
}
Expand Down
2 changes: 1 addition & 1 deletion Whisky/Utils/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Log {
static let logsFolder = FileManager.default.urls(for: .libraryDirectory,
in: .userDomainMask)[0]
.appendingPathComponent("Logs")
.appendingPathComponent("Whisky")
.appendingPathComponent(Bundle.main.bundleIdentifier ?? "com.isaacmarovitz.Whisky")

let fileHandle: FileHandle
let logger: Logger
Expand Down
4 changes: 2 additions & 2 deletions Whisky/Utils/WineInstaller.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class WineInstaller {
static let WineBinaryVersion = Bundle.main.infoDictionary?["WineBinaryVersion"] as? Int ?? 0

static let libraryFolder = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask)[0]
.appendingPathComponent("Whisky")
.appendingPathComponent(Bundle.main.bundleIdentifier ?? "com.isaacmarovitz.Whisky")
.appendingPathComponent("Libraries")

static func isWineInstalled() -> Bool {
Expand All @@ -23,7 +23,7 @@ class WineInstaller {
do {
let whiskySupportFolder = FileManager.default.urls(for: .applicationSupportDirectory,
in: .userDomainMask)[0]
.appendingPathComponent("Whisky")
.appendingPathComponent(Bundle.main.bundleIdentifier ?? "com.isaacmarovitz.Whisky")

if !FileManager.default.fileExists(atPath: whiskySupportFolder.path) {
try FileManager.default.createDirectory(at: whiskySupportFolder, withIntermediateDirectories: true)
Expand Down
2 changes: 1 addition & 1 deletion Whisky/View Models/BottleVM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class BottleVM: ObservableObject {
static let containerDir = FileManager.default.homeDirectoryForCurrentUser
.appendingPathComponent("Library")
.appendingPathComponent("Containers")
.appendingPathComponent("com.isaacmarovitz.Whisky")
.appendingPathComponent(Bundle.main.bundleIdentifier ?? "com.isaacmarovitz.Whisky")

static let bottleDir = containerDir
.appendingPathComponent("Bottles")
Expand Down