Fix path bugs in ArchiveUtil
This commit is contained in:
parent
39a9330969
commit
0697d8b233
|
@ -22,6 +22,7 @@
|
||||||
// OTHER DEALINGS IN THE SOFTWARE.
|
// OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
import Cocoa
|
import Cocoa
|
||||||
|
import Foundation
|
||||||
|
|
||||||
struct ArchiveUtil {
|
struct ArchiveUtil {
|
||||||
var appName: String
|
var appName: String
|
||||||
|
@ -95,16 +96,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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +115,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