Open jgabaut opened 6 days ago
On macOS, realpath may not be GNU realpath, and their behaviour is not consistent for this call:
macOS
realpath
GNU realpath
FILE=dir/folder/file.txt printf "$(realpath "$(basename "$FILE")")\n"
For GNU realpath:
> /home/user/dir/folder/file.txt // Example full path
For macOS realpath:
macOS realpath
> realpath: file.txt: No such file or directory
This can be fixed by avoiding expecting a full canonicalized path downstream, instead accepting a relative one, formatted from known path sections.
References:
On
macOS
,realpath
may not beGNU realpath
, and their behaviour is not consistent for this call:For
GNU realpath
:For
macOS realpath
:This can be fixed by avoiding expecting a full canonicalized path downstream, instead accepting a relative one, formatted from known path sections.
References: