[Fix #396] Remove the osx trash function
The trash program found at http://hasseg.org/trash is a superior implementation.
This commit is contained in:
parent
6e65349c45
commit
e2c5f2fb2c
|
@ -20,7 +20,6 @@ Functions
|
||||||
- `pfd` prints the current _Finder_ directory.
|
- `pfd` prints the current _Finder_ directory.
|
||||||
- `pfs` prints the current _Finder_ selection.
|
- `pfs` prints the current _Finder_ selection.
|
||||||
- `tab` creates a new tab (works in both _Terminal_ and [_iTerm_][3]).
|
- `tab` creates a new tab (works in both _Terminal_ and [_iTerm_][3]).
|
||||||
- `trash` moves files and folders to _Trash_.
|
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
-------
|
-------
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
#
|
|
||||||
# Moves directories and files to Trash.
|
|
||||||
#
|
|
||||||
# Authors:
|
|
||||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
||||||
#
|
|
||||||
|
|
||||||
print -N "${@:a}" | xargs -0 osascript -e '
|
|
||||||
on run theFilePaths
|
|
||||||
tell application "Finder"
|
|
||||||
set thePOSIXFiles to {}
|
|
||||||
repeat with aFilePath in theFilePaths
|
|
||||||
set aPOSIXFile to aFilePath as POSIX file
|
|
||||||
if exists aPOSIXFile
|
|
||||||
set end of thePOSIXFiles to aPOSIXFile
|
|
||||||
end if
|
|
||||||
end repeat
|
|
||||||
move every item of thePOSIXFiles to trash
|
|
||||||
end tell
|
|
||||||
end run
|
|
||||||
' &>/dev/null
|
|
||||||
|
|
||||||
if (( $? != 0)); then
|
|
||||||
print "$0: failed to move one or more items" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
Loading…
Reference in a new issue