You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found this project while searching for a pure perl implementation of realpath. I was curious to see your tests and I have replaced the body of your realpath() function with a call of my system realpath
realpath() {
/opt/freeware/bin/realpath "$1"
}
My system realpath is part of the rpm package coreutils-8.25-1.ppc. The test it_outputs_pwd_when_passed_zero_args
fails. The system realpath does not like a zero arguments or an empty string argument. You have implemented a kind of fallback or default behaviour. We could argue, if this a good idea, assuming that the behaviour of both realpath implementations should be identical.
What I do not understand is why the default behaviour returns a slash terminated PWD instead of PWD itself. Maybe you could say some words about your motivation. I would have used the variable substitution operator :- instead
I was curious to see your tests and I have replaced the body of your realpath() function with a call of my system realpath
I never actually tried that, but I like the idea 👍
What I do not understand is why the default behaviour returns a slash terminated $PWD instead of $PWD itself. Maybe you could say some words about your motivation.
I don't recall the original motivation. However, my guess is that I didn't think about it all that much. I probably just wanted it to do something.
I like the idea of it returning $PWD instead of $PWD/. I'd merge a PR that changes this behavior.
Dear Michael,
I have found this project while searching for a pure perl implementation of
realpath
. I was curious to see your tests and I have replaced the body of yourrealpath()
function with a call of my systemrealpath
My system
realpath
is part of the rpm package coreutils-8.25-1.ppc. The test it_outputs_pwd_when_passed_zero_argsfails. The system
realpath
does not like a zero arguments or an empty string argument. You have implemented a kind of fallback or default behaviour. We could argue, if this a good idea, assuming that the behaviour of bothrealpath
implementations should be identical.What I do not understand is why the default behaviour returns a slash terminated PWD instead of PWD itself. Maybe you could say some words about your motivation. I would have used the variable substitution operator :- instead
This would run
_canonicalize_dir_path()
instead of_canonicalize_file_path()
and it would return PWD.Kind regards
Sven
The text was updated successfully, but these errors were encountered: