Sharing one thing that saves me a few minutes per ...
# resources
y
Sharing one thing that saves me a few minutes per day on projects where data is fully local. What I often do is clean all
data
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:
Copy code
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.
❤️ 8