aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils
diff options
context:
space:
mode:
authorMarkus Reiter2017-06-30 14:38:57 +0200
committerGitHub2017-06-30 14:38:57 +0200
commit29ffe158903c0528c672da50c2b83b1b5d8cbe1c (patch)
tree607c312a5146c74b6d26cde2aeeef6474e5c43a8 /Library/Homebrew/utils
parent0077e4f20ef9d107a0ca8c5ab75cac552163fb45 (diff)
parenta636d5806705c2ccc68fb9d4fad0ee92dfe06bc8 (diff)
downloadbrew-29ffe158903c0528c672da50c2b83b1b5d8cbe1c.tar.bz2
Merge pull request #2819 from reitermarkus/trash
🗑️ Use AppleScript instead of Swift for trashing.
Diffstat (limited to 'Library/Homebrew/utils')
-rwxr-xr-xLibrary/Homebrew/utils/trash.swift43
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()