We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c9e72a commit e84b799Copy full SHA for e84b799
scripts/profile-compilation
@@ -1,7 +1,7 @@
1
#!/bin/bash
2
3
COMPILE_COMMADS=$PWD/compile_commands.json
4
-FILENAME=$PWD/$1
+FILENAME=$1
5
CLANG_PATH=${CLANG_PATH:-clang++}
6
-cd `cat $COMPILE_COMMADS | jq ".[] | select(.file == \"$FILENAME\")" | jq -r '.directory'`
7
-`cat $COMPILE_COMMADS | jq ".[] | select(.file == \"$FILENAME\")" | jq ".command |= (sub(\"^.*/c[+][+]\";\"$CLANG_PATH -ftime-trace\"))" | jq -r '.command'`
+cd `cat $COMPILE_COMMADS | jq ".[] | select(.file|test(\".*$FILENAME\"))" | jq -r '.directory'`
+`cat $COMPILE_COMMADS | jq ".[] | select(.file|test(\".*$FILENAME\"))" | jq ".command |= (sub(\"^.*/c[+][+]\";\"$CLANG_PATH -ftime-trace\"))" | jq -r '.command'`
0 commit comments