Skip to content

Commit 77dec64

Browse files
committed
first try for script
1 parent 69996eb commit 77dec64

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/scripts/ptc.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ sed --in-place '/^\/\/NOLINTNEXTLINE(readability-identifier-naming)$/d' ../libra
2929
#adds hash code comments
3030
chmod +x ../library/contest/hash.sh
3131
for header in ../library/**/*.hpp; do
32-
hash=$(sed '/^#include/d' "$header" | cpp -dD -P -fpreprocessed | ./../library/contest/hash.sh)
33-
sed --in-place "1i //hash: $hash" "$header"
32+
cp $header input
33+
lines="$(cat input | wc -l)"
34+
echo $lines
35+
for i in $(seq 1 $lines); do
36+
hash=$(head -n $i input | sed '/^#include/d' | cpp -dD -P -fpreprocessed | ./../library/contest/hash.sh)
37+
sed -i "${i}s/^/\/\*${hash}\*\/ /" $header
38+
done
3439
done
3540

3641
git submodule init

0 commit comments

Comments
 (0)