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)
|
||||
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue