Skip to content

Commit 7e37381

Browse files
committed
feat: Add CSV target directory creation for incremental commits in exportAndPushCSVToGitHub.sh
- Introduced a new variable for the CSV target directory to support incremental commits. - Ensured the target directory is created at the start of the export process, enhancing the script's robustness. - Removed redundant directory creation code from the export summary section for cleaner execution flow.
1 parent 1064247 commit 7e37381

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bin/dwh/exportAndPushCSVToGitHub.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ print_info "Country list retrieved in ${COUNTRY_LIST_DURATION}s"
263263
COUNTRIES_PER_COMMIT="${COUNTRIES_PER_COMMIT:-20}"
264264
readonly COUNTRIES_PER_COMMIT
265265

266+
# CSV target directory (needed for incremental commits)
267+
CSV_TARGET_DIR="${DATA_REPO_DIR}/csv/notes-by-country"
268+
mkdir -p "${CSV_TARGET_DIR}"
269+
266270
TOTAL_COUNTRIES=0
267271
EXPORTED_COUNTRIES=0
268272
TOTAL_NOTES=0
@@ -387,10 +391,6 @@ print_success "Export completed: ${EXPORTED_COUNTRIES} countries, ${TOTAL_NOTES}
387391
print_info "Export timing: ${EXPORT_DURATION}s (countries: ${EXPORTED_COUNTRIES}, avg: ${AVG_TIME_PER_COUNTRY}s per country)"
388392
print_info "Step 1 total time: ${STEP1_DURATION}s"
389393

390-
# Step 2: Ensure CSV_TARGET_DIR exists (already created during incremental commits)
391-
CSV_TARGET_DIR="${DATA_REPO_DIR}/csv/notes-by-country"
392-
mkdir -p "${CSV_TARGET_DIR}"
393-
394394
# Final summary
395395
TOTAL_END=$(date +%s)
396396
TOTAL_DURATION=$((TOTAL_END - STEP1_START))

0 commit comments

Comments
 (0)