Skip to content

Commit 7a3a3fe

Browse files
committed
Fix GTFS archive compat with older in-progress archive
1 parent cc00ed6 commit 7a3a3fe

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

shared-opt-dir/agency-parser/archive.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,14 @@ if [[ "$GTFS_DIR_COUNT" -gt 0 ]]; then
108108
echo "- GTFS is entirely inside the new ZIP > REMOVE";
109109
rm -r "$GTFS_DIR";
110110
checkResult $?;
111-
elif [[ "$GTFS_DIR_START_DATE" -lt "$YESTERDAY" && "$GTFS_DIR_END_DATE" -le "$END_DATE" ]]; then
112-
echo "- GTFS (after $YESTERDAY) is entirely inside the new one > REMOVE";
111+
elif [[ "$GTFS_DIR_START_DATE" -lt "$YESTERDAY" && "$START_DATE" -le "$YESTERDAY" && "$GTFS_DIR_END_DATE" -le "$END_DATE" ]]; then
112+
echo "- GTFS (after $YESTERDAY) is entirely inside the new (in-progress) one > REMOVE";
113113
rm -r "$GTFS_DIR";
114114
checkResult $?;
115115
elif [[ "$GTFS_DIR_START_DATE" -gt "$END_DATE" && "$GTFS_DIR_END_DATE" -gt "$YESTERDAY" ]]; then
116116
echo "- GTFS is entirely in the future & newer than new ZIP > KEEP";
117+
elif [[ "$GTFS_DIR_END_DATE" -ge "$YESTERDAY" && "$GTFS_DIR_END_DATE" -lt "$START_DATE" ]]; then
118+
echo "- GTFS is in-progress & older than new ZIP > KEEP";
117119
else
118120
echo "- TODO handle this case?";
119121
# - new ZIP file (future) is entirely inside archive ZIP file (current)
@@ -127,4 +129,4 @@ NEW_ARCHIVE_DIR="${ARCHIVE_DIR}/${START_DATE}-${END_DATE}";
127129
cp -R "$FILES_DIR/." "$NEW_ARCHIVE_DIR";
128130
checkResult $?;
129131

130-
echo ">> Archiving GTFS... DONE ($ARCHIVE_FILE)"
132+
echo ">> Archiving GTFS... DONE ($NEW_ARCHIVE_DIR)"

0 commit comments

Comments
 (0)