mirror of
https://github.com/mas-cli/mas
synced 2025-02-16 12:38:30 +00:00
🔊 Log message showing trashed app location
This commit is contained in:
parent
1925144366
commit
1f84bf2340
1 changed files with 11 additions and 1 deletions
|
@ -42,7 +42,17 @@ public class MasAppLibrary: AppLibrary {
|
|||
let appUrl = URL(fileURLWithPath: app.bundlePath)
|
||||
|
||||
do {
|
||||
try fileManager.trashItem(at: appUrl, resultingItemURL: nil)
|
||||
var trashUrl: NSURL?
|
||||
try withUnsafeMutablePointer(to: &trashUrl) { (mutablePointer: UnsafeMutablePointer<NSURL?>) in
|
||||
let pointer = AutoreleasingUnsafeMutablePointer<NSURL?>(mutablePointer)
|
||||
|
||||
// Move item to trash
|
||||
try fileManager.trashItem(at: appUrl, resultingItemURL: pointer)
|
||||
|
||||
if let url = pointer.pointee, let path = url.path {
|
||||
printInfo("App moved to trash: \(path)")
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
printError("Unable to move app to trash.")
|
||||
throw MASError.uninstallFailed
|
||||
|
|
Loading…
Add table
Reference in a new issue