Yury Fedotov
07/24/2024, 7:17 PMdata
folders except 01_raw
before doing kedro run
to ensure that all contents of other data
folders are latest.
Manually, that requires opening 7 folders, selecting files, etc.
This is a Makefile
command that helps automate that:
DATA_DIR := data
EXCLUDE_DIR := $(DATA_DIR)/01_raw
DIRS := $(filter-out $(EXCLUDE_DIR), $(wildcard $(DATA_DIR)/*))
# Delete all contents of non-raw data folders except for .gitkeep files
delete-non-raw-data:
@for dir in $(DIRS); do \
find $$dir -mindepth 1 ! -name '.gitkeep' -delete; \
done
.PHONY: delete-non-raw-data
So I just do make delete-non-raw-data
and it does what I described above.