Skip to content

Commit 43c2a49

Browse files
committed
cleanup rm
1 parent 8171143 commit 43c2a49

1 file changed

Lines changed: 26 additions & 30 deletions

File tree

Makefile

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ REMOTE := origin
3232
HOST := 127.0.0.1
3333
PORT := 8000
3434

35-
PYTEST_OPTS := -q
35+
PYTEST_OPTS :=
3636
SPHINX_OPTS := -T -E -b html -d $(DOCS_DIR)/_build/doctrees -D language=en
3737
PYLINT_TARGETS := miepython/*.py tests/*.py .github/scripts/update_citation.py
3838
YAML_TARGETS := .github/workflows/citation.yaml .github/workflows/pypi.yaml .github/workflows/test.yaml .readthedocs.yaml
@@ -160,21 +160,19 @@ lite: $(LITE_CONFIG)
160160
echo " Found .gh-pages worktree, removing..."; \
161161
git worktree remove "$(WORKTREE)" --force 2>/dev/null || true; \
162162
git worktree prune; \
163-
rm -rf "$(WORKTREE)"; \
163+
$(RMR) "$(WORKTREE)"; \
164164
echo " ✓ Removed"; \
165165
else \
166166
echo " No .gh-pages worktree found"; \
167167
fi
168168

169169
@echo "==> Cleaning previous builds"
170-
@/bin/rm -rf "$(OUT_ROOT)"
171-
@/bin/rm -rf "$(DOIT_DB)"
172-
@/bin/rm -rf ".doit.db"
173-
@/bin/rm -rf ".jupyterlite.doit.db.db"
170+
@$(RMR) "$(OUT_ROOT)"
171+
@$(RMR) "$(DOIT_DB)"
174172
@echo " ✓ Cleaned"
175173

176174
@echo "==> Staging notebooks from docs -> $(STAGE_DIR)"
177-
@/bin/rm -rf "$(STAGE_DIR)"; mkdir -p "$(STAGE_DIR)"
175+
@$(RMR) "$(STAGE_DIR)"; mkdir -p "$(STAGE_DIR)"
178176
@if ls docs/*.ipynb 1> /dev/null 2>&1; then \
179177
/bin/cp docs/*.ipynb "$(STAGE_DIR)"; \
180178
mkdir -p "$(STAGE_DIR)/examples"; \
@@ -230,7 +228,7 @@ lite-deploy:
230228
@echo "==> Setup deployment worktree"
231229
@git worktree remove "$(WORKTREE)" --force 2>/dev/null || true
232230
@git worktree prune || true
233-
@rm -rf "$(WORKTREE)"
231+
@$(RMR) "$(WORKTREE)"
234232
@git worktree add "$(WORKTREE)" "$(PAGES_BRANCH)"
235233
@git -C "$(WORKTREE)" pull "$(REMOTE)" "$(PAGES_BRANCH)" 2>/dev/null || true
236234

@@ -269,34 +267,32 @@ speed:
269267
.PHONY: clean
270268
clean:
271269
@echo "==> Cleaning build artifacts"
272-
@find . -name '__pycache__' -type d -exec rm -rf {} +
270+
@find . -name '__pycache__' -type d -exec $(RMR) {} +
273271
@find . -name '.DS_Store' -type f -delete
274-
@find . -name '.ipynb_checkpoints' -type d -prune -exec rm -rf {} +
275-
@find . -name '.pytest_cache' -type d -prune -exec rm -rf {} +
276-
@/bin/rm -rf .cache
277-
@/bin/rm -rf .ruff_cache
278-
@/bin/rm -rf $(PACKAGE).egg-info
279-
@/bin/rm -rf docs/api
280-
@/bin/rm -rf docs/_build
281-
@/bin/rm -rf docs/.jupyter
282-
@/bin/rm -rf dist
272+
@find . -name '.ipynb_checkpoints' -type d -prune -exec $(RMR) {} +
273+
@find . -name '.pytest_cache' -type d -prune -exec $(RMR) {} +
274+
@$(RMR) .cache
275+
@$(RMR) .ruff_cache
276+
@$(RMR) $(PACKAGE).egg-info
277+
@$(RMR) docs/api
278+
@$(RMR) docs/_build
279+
@$(RMR) docs/.jupyter
280+
@$(RMR) dist
283281

284282
.PHONY: lite-clean
285283
lite-clean:
286284
@echo "==> Cleaning JupyterLite build artifacts"
287-
@/bin/rm -rf "$(STAGE_DIR)"
288-
@/bin/rm -rf "$(OUT_ROOT)"
289-
@/bin/rm -rf ".lite_root"
290-
@/bin/rm -rf "$(DOIT_DB)"
291-
@/bin/rm -rf "_output"
285+
@$(RMR) "$(STAGE_DIR)"
286+
@$(RMR) "$(OUT_ROOT)"
287+
@$(RMR) ".lite_root"
288+
@$(RMR) "$(DOIT_DB)"
289+
@$(RMR) _output
292290

293291
.PHONY: realclean
294292
realclean: lite-clean clean
295293
@echo "==> Deep cleaning: removing venv and deployment worktree"
296-
# @git worktree remove "$(WORKTREE)" --force 2>/dev/null || true
297-
@/bin/rm -rf .tmp
298-
@/bin/rm -rf "$(WORKTREE)"
299-
@/bin/rm -rf "$(VENV)"
300-
@/bin/rm -rf "docs/_templates"
301-
@/bin/rm -r uv.lock
302-
294+
@$(RMR) .tmp
295+
@$(RMR) "$(WORKTREE)"
296+
@$(RMR) "$(VENV)"
297+
@$(RMR) docs/_templates
298+
@$(RM) uv.lock

0 commit comments

Comments
 (0)