refactor: reformat zig wrapper

This commit is contained in:
CJ van den Berg 2024-07-02 12:21:57 +02:00
parent 16ec05c75b
commit 5bc0ca5f74

12
zig
View file

@ -32,12 +32,12 @@ if [ "$1" == "update" ] ; then
NEWVERSION=$(<build.zig.version)
if [ "$VERSION" != "$NEWVERSION" ]; then
echo zig version updated from $VERSION to $NEWVERSION
echo rebuilding to update cdb...
echo "zig version updated from $VERSION to $NEWVERSION"
echo "rebuilding to update cdb..."
$0 cdb
exit 0
fi
echo zig version $VERSION is up-to-date
echo "zig version $VERSION is up-to-date"
exit 0
fi
@ -63,7 +63,11 @@ if [ "$1" == "cdb" ] ; then
$ZIG build
(echo \[ ; cat .cache/cdb/* ; echo {}\]) | perl -0777 -pe 's/,\n\{\}//igs' | jq . | grep -v 'no-default-config' > compile_commands.json
(
echo \[
cat .cache/cdb/*
echo {}\]
) | perl -0777 -pe 's/,\n\{\}//igs' | jq . | grep -v 'no-default-config' >compile_commands.json
exit 0
fi