Skip to content

Commit 29b916e

Browse files
committed
Added offsets migration tool
1 parent 28b595e commit 29b916e

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ obj/
1515
*.ap_
1616

1717
# Generated files
18-
bin/
1918
gen/
2019
out/
2120
build/

bin/migrate-offsets-to-0.6.0.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
set -e
4+
if [ ! -f offsets.csv ]; then
5+
echo "Can only migrate offsets if the current directory contains offsets.csv"
6+
exit 1
7+
fi
8+
9+
mkdir -p offsets
10+
TOPICS=$(tail -n+2 offsets.csv | cut -d , -f 4 | sort -u)
11+
for topic in $TOPICS; do
12+
target="offsets/$topic.csv"
13+
echo "Updating $target"
14+
if [ ! -f "$target" ]; then
15+
head -n 1 offsets.csv > "$target"
16+
fi
17+
grep ",$topic\$" offsets.csv >> "$target"
18+
done

0 commit comments

Comments
 (0)