jgabaut / amboso

Build tool wrapping make. Written in bash.
GNU General Public License v3.0
4 stars 0 forks source link

[BUG] realpath usage leads to inconsistent behaviour on mac #120

Open jgabaut opened 6 days ago

jgabaut commented 6 days ago

On macOS, realpath may not be GNU realpath, and their behaviour is not consistent for this call:

  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:

> 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: