diff options
| author | Markus Reiter | 2017-06-24 07:01:35 +0200 |
|---|---|---|
| committer | Markus Reiter | 2017-06-24 09:15:37 +0200 |
| commit | a1f9032b9574dcb27b34a6deb4c9730839daf0df (patch) | |
| tree | 97ccd340be363f7e18dfe879cc2a588ff2135f8d /Library/Homebrew/utils | |
| parent | f4f1f1a6108970bf646aad82305978262c671ee2 (diff) | |
| download | brew-a1f9032b9574dcb27b34a6deb4c9730839daf0df.tar.bz2 | |
🗑️ Use AppleScript instead of Swift for trashing.
Diffstat (limited to 'Library/Homebrew/utils')
| -rwxr-xr-x | Library/Homebrew/utils/trash.swift | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/Library/Homebrew/utils/trash.swift b/Library/Homebrew/utils/trash.swift deleted file mode 100755 index f591c3806..000000000 --- a/Library/Homebrew/utils/trash.swift +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/swift - -import Cocoa - -DispatchQueue.main.async { - let arguments = CommandLine.arguments.dropFirst().filter { !$0.isEmpty } - let URLs = arguments.map { URL(fileURLWithPath: $0) } - - #if swift(>=4.0) - let workspace = NSWorkspace.shared - #else - let workspace = NSWorkspace.shared() - #endif - - workspace.recycle(URLs) { (dict, error) in - dict.forEach { - #if swift(>=4.0) - let originalPath = $0.0.path - let trashPath = $0.1.path - #else - let originalPath = $0.path - let trashPath = $1.path - #endif - - print("moved \(originalPath) to \(trashPath)") - } - - if error == nil { - exit(0) - } - - let trashedURLs = dict.keys - let untrashedURLs = URLs.filter { !trashedURLs.contains($0) } - - untrashedURLs.forEach { - fputs("could not move \($0.path) to trash\n", stderr) - } - - exit(1) - } -} - -RunLoop.main.run() |
