AutoYADM commit: 2025-07-14 22:40:39

This commit is contained in:
Daniel Fichtinger 2025-07-14 22:40:39 -04:00
parent 7a0b858b3c
commit bd10e6bfc3

View file

@ -4,15 +4,16 @@ function uri-path
echo "Convert a file URI to a Path." echo "Convert a file URI to a Path."
echo "-h/--help for help." echo "-h/--help for help."
echo "-r/--reverse to convert a path to URI." echo "-r/--reverse to convert a path to URI."
return 0
end end
if test -z "$argv[1]" if test -z "$argv"
read -f input read -f input
else else
set input $argv[1] set input $argv
end end
if not set -q _flag_r if not set -q _flag_r
string unescape --style=url "$input" | string replace -a ' ' '\\ ' | string replace 'file://' '' string unescape --style=url "$input" | string replace 'file://' ''
else else
printf 'file://%s\n' (string replace '\\ ' ' ' "$input" | string escape --style=url) printf 'file://%s\n' (string escape --style=url "$input")
end end
end end