scripts: fix wl-copy-file path handling

This commit is contained in:
Leonardo Eugênio 2024-02-06 20:54:50 -03:00
parent 7e2c9b087a
commit a587610fd1

View file

@ -10,12 +10,13 @@ if test (count $argv) != 1
end
set -a file (realpath $argv[1])
set -a url (string escape --style=url "$file")
set -e argv[1]
if test -d "$file"
die 1 "Cannot copy directories" >&2
else if test -f "$file"
wl-copy $argv -t text/uri-list "file:///$file"
wl-copy $argv -t text/uri-list "file:///$url"
else
die 2 "No file found" >&2
end