From d33976f2e2666ba1b2049db1f0a56daacddc8a11 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 4 Nov 2024 17:06:22 +0100 Subject: [PATCH] small fixes --- .config/fish/functions/trash.fish | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/fish/functions/trash.fish b/.config/fish/functions/trash.fish index 39b60f1..d7a38d0 100644 --- a/.config/fish/functions/trash.fish +++ b/.config/fish/functions/trash.fish @@ -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')"