Fix for issue when copying items from a dmg that are not at the dmg root

This commit is contained in:
Greg Neagle
2025-10-09 20:23:37 -07:00
parent 64da9216da
commit 3e365ea241
+3 -3
View File
@@ -79,9 +79,9 @@ func validateSourceAndDestination(mountpoint: String, item: PlistDict) -> (Bool,
// source_item if not.
var fullDestinationPath = ""
if destinationItemName.isEmpty {
fullDestinationPath = (destinationPath as NSString).appendingPathComponent(sourceItemName)
fullDestinationPath = (destinationPath as NSString).appendingPathComponent(baseName(sourceItemName))
} else {
fullDestinationPath = (destinationPath as NSString).appendingPathComponent(destinationItemName)
fullDestinationPath = (destinationPath as NSString).appendingPathComponent(baseName(destinationItemName))
}
return (true, sourceItemPath, fullDestinationPath)
}
@@ -169,7 +169,7 @@ func copyItemsFromMountpoint(_ mountpoint: String, itemList: [PlistDict]) async
// setPermissions already displayed an error
return permsresult
}
// remove any previously exiting item at destinationPatj
// remove any previously exiting item at destinationPath
if pathExists(destinationPath) {
do {
try FileManager.default.removeItem(atPath: destinationPath)