small fixes
This commit is contained in:
parent
c933f22b37
commit
d33976f2e2
1 changed files with 4 additions and 4 deletions
|
@ -19,17 +19,17 @@ function trash --description "Move file or directory to the windows recycle bin.
|
|||
set temp_dir (powershell.exe -Command "Write-Host \$env:TEMP")
|
||||
set path (wslpath -w $element)
|
||||
|
||||
# Move element to TEMP windows directory
|
||||
# Move element to temporary windows directory
|
||||
cmd.exe /c "MKDIR $temp_dir 2>NUL" &> /dev/null
|
||||
powershell.exe -Command "Copy-Item $path -Destination $temp_dir"
|
||||
powershell.exe -Command "Copy-Item \"$path\" -Destination \"$temp_dir\""
|
||||
|
||||
# Switch between trashing a file or a directory
|
||||
set switch DeleteFile
|
||||
if test -d $element
|
||||
set switch DeleteDirectory
|
||||
end
|
||||
|
||||
|
||||
# Move path to Windows trash
|
||||
# Move element to the Windows trash
|
||||
powershell.exe -Command "" \
|
||||
"Add-Type -AssemblyName Microsoft.VisualBasic;" \
|
||||
"[Microsoft.VisualBasic.FileIO.FileSystem]::$switch('$temp_dir\\$element', 'OnlyErrorDialogs', 'SendToRecycleBin')"
|
||||
|
|
Loading…
Reference in a new issue