Lukhnos: Installer // Fix path bugs in ArchiveUtil.
Co-Authored-By: Lukhnos Liu <lukhnos@lukhnos.org>
This commit is contained in:
parent
1424d142db
commit
8341f6d983
|
@ -91,16 +91,16 @@ struct ArchiveUtil {
|
||||||
unzipTask.waitUntilExit()
|
unzipTask.waitUntilExit()
|
||||||
|
|
||||||
assert(unzipTask.terminationStatus == 0, "Must successfully unzipped")
|
assert(unzipTask.terminationStatus == 0, "Must successfully unzipped")
|
||||||
guard let result = (tempFilePath as NSString).appendingPathExtension(targetAppBundleName) else {
|
let result = (tempFilePath as NSString).appendingPathComponent(targetAppBundleName)
|
||||||
return nil
|
assert(FileManager.default.fileExists(atPath: result), "App bundle must be unzipped at \(result).")
|
||||||
}
|
|
||||||
assert(FileManager.default.fileExists(atPath: result), "App bundle must be unzipped at \(resourcePath).")
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
private var notarizedArchivesPath: String? {
|
private var notarizedArchivesPath: String? {
|
||||||
let resourePath = Bundle.main.resourcePath
|
guard let resourePath = Bundle.main.resourcePath else {
|
||||||
let notarizedArchivesPath = resourePath?.appending("NotarizedArchives")
|
return nil
|
||||||
|
}
|
||||||
|
let notarizedArchivesPath = (resourePath as NSString).appendingPathComponent("NotarizedArchives")
|
||||||
return notarizedArchivesPath
|
return notarizedArchivesPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ struct ArchiveUtil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
let notarizedArchiveBasename = "\(appName)-r\(bundleVersion).zip"
|
let notarizedArchiveBasename = "\(appName)-r\(bundleVersion).zip"
|
||||||
let notarizedArchive = notarizedArchivesPath.appending(notarizedArchiveBasename)
|
let notarizedArchive = (notarizedArchivesPath as NSString).appendingPathComponent(notarizedArchiveBasename)
|
||||||
return notarizedArchive
|
return notarizedArchive
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue