refactor: reformat zig wrapper
This commit is contained in:
parent
16ec05c75b
commit
5bc0ca5f74
1 changed files with 22 additions and 18 deletions
12
zig
12
zig
|
@ -32,12 +32,12 @@ if [ "$1" == "update" ] ; then
|
||||||
NEWVERSION=$(<build.zig.version)
|
NEWVERSION=$(<build.zig.version)
|
||||||
|
|
||||||
if [ "$VERSION" != "$NEWVERSION" ]; then
|
if [ "$VERSION" != "$NEWVERSION" ]; then
|
||||||
echo zig version updated from $VERSION to $NEWVERSION
|
echo "zig version updated from $VERSION to $NEWVERSION"
|
||||||
echo rebuilding to update cdb...
|
echo "rebuilding to update cdb..."
|
||||||
$0 cdb
|
$0 cdb
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo zig version $VERSION is up-to-date
|
echo "zig version $VERSION is up-to-date"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -63,7 +63,11 @@ if [ "$1" == "cdb" ] ; then
|
||||||
|
|
||||||
$ZIG build
|
$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
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue