scripts: fix wl-copy-file path handling
This commit is contained in:
parent
7e2c9b087a
commit
a587610fd1
|
@ -10,12 +10,13 @@ if test (count $argv) != 1
|
||||||
end
|
end
|
||||||
|
|
||||||
set -a file (realpath $argv[1])
|
set -a file (realpath $argv[1])
|
||||||
|
set -a url (string escape --style=url "$file")
|
||||||
set -e argv[1]
|
set -e argv[1]
|
||||||
|
|
||||||
if test -d "$file"
|
if test -d "$file"
|
||||||
die 1 "Cannot copy directories" >&2
|
die 1 "Cannot copy directories" >&2
|
||||||
else if test -f "$file"
|
else if test -f "$file"
|
||||||
wl-copy $argv -t text/uri-list "file:///$file"
|
wl-copy $argv -t text/uri-list "file:///$url"
|
||||||
else
|
else
|
||||||
die 2 "No file found" >&2
|
die 2 "No file found" >&2
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue