fix unpredictable behavior in doxygen generator script
authorEli Schwartz <eschwartz93@gmail.com>
Wed, 19 Oct 2022 22:08:15 +0000 (18:08 -0400)
committerColin Clark <colin.clark@cclark.uk>
Thu, 20 Oct 2022 11:11:46 +0000 (12:11 +0100)
We know that SRCDIR is the location of doxygen.conf, and that it is ../
from the doc directory. But we don't know that the current working
directory of the script is the doc directory -- the reference version of
Meson currently sets that, but other implementations of Meson such as
muon (c99) set it to the project root. Meson's own documentation says to
NOT rely on this as it is officially unspecified.

The solution is actually super simple though, because we already pass
the project root as a script argument, so just... use that. :D

doc/create-doxygen-lua-api.sh

index e3dac94..4c3402f 100755 (executable)
@@ -100,7 +100,7 @@ BEGIN {
                {print}
                }
 }
-' ../doxygen.conf > "$TMPFILE"
+' "$SRCDIR"/doxygen.conf > "$TMPFILE"
 
 doxygen "$TMPFILE"