Skip to content

Commit 0a8e55c

Browse files
committed
Two fixes to the humbug.bash script.
1. Order the query results, to ensure that pagination works. 2. Left-pad the filenames with zeros, so that their lexicographic sort order (as returned by ls) is also their pagination order.
1 parent 20986e7 commit 0a8e55c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/humbug.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ echo "Processing in batches of size BUGOUT_SEARCH_LIMIT=$BUGOUT_SEARCH_LIMIT"
6464
OFFSET=0
6565
while [ "$OFFSET" -lt "$TOTAL_RESULTS" ]
6666
do
67-
OUTPUT_FILE="$BUGOUT_OUTPUT_DIRECTORY/$OFFSET.json"
67+
OUTPUT_FILE="$BUGOUT_OUTPUT_DIRECTORY/$(printf "%07d" $OFFSET).json"
6868
echo "Processing $BUGOUT_SEARCH_LIMIT items with offset $OFFSET into $OUTPUT_FILE"
69-
bugout entries search "$SEARCH_QUERY" --limit "$BUGOUT_SEARCH_LIMIT" --offset "$OFFSET" > "$OUTPUT_FILE"
69+
bugout entries search "$SEARCH_QUERY" --params order=asc --limit "$BUGOUT_SEARCH_LIMIT" --offset "$OFFSET" > "$OUTPUT_FILE"
7070
OFFSET=$((OFFSET + BUGOUT_SEARCH_LIMIT))
7171
done

0 commit comments

Comments
 (0)