Lukhnos: Installer // Fix path bugs in ArchiveUtil.

This commit is contained in:
ShikiSuen 2022-02-14 22:56:18 +08:00
parent 67af811b95
commit 5f81e1a758
1 changed files with 7 additions and 7 deletions

View File

@ -91,16 +91,16 @@ struct ArchiveUtil {
unzipTask.waitUntilExit()
assert(unzipTask.terminationStatus == 0, "Must successfully unzipped")
guard let result = (tempFilePath as NSString).appendingPathExtension(targetAppBundleName) else {
return nil
}
assert(FileManager.default.fileExists(atPath: result), "App bundle must be unzipped at \(resourcePath).")
let result = (tempFilePath as NSString).appendingPathComponent(targetAppBundleName)
assert(FileManager.default.fileExists(atPath: result), "App bundle must be unzipped at \(result).")
return result
}
private var notarizedArchivesPath: String? {
let resourePath = Bundle.main.resourcePath
let notarizedArchivesPath = resourePath?.appending("NotarizedArchives")
guard let resourePath = Bundle.main.resourcePath else {
return nil
}
let notarizedArchivesPath = (resourePath as NSString).appendingPathComponent("NotarizedArchives")
return notarizedArchivesPath
}
@ -110,7 +110,7 @@ struct ArchiveUtil {
return nil
}
let notarizedArchiveBasename = "\(appName)-r\(bundleVersion).zip"
let notarizedArchive = notarizedArchivesPath.appending(notarizedArchiveBasename)
let notarizedArchive = (notarizedArchivesPath as NSString).appendingPathComponent(notarizedArchiveBasename)
return notarizedArchive
}