Skip to content

Commit

Permalink
tool(makefile): Add new target cleandocs to remove doc/content/*.md
Browse files Browse the repository at this point in the history
Now 'make clean' does not delete any prior exported files from ox-hugo-manual.org.
  • Loading branch information
kaushalmodi committed May 12, 2022
1 parent 3e8be6c commit 6c6c0ba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ test_check=1
test md ert testmkgold \
do_test $(test_org_files) \
changelog doc_md doc_gh doc doc_htmltest doc_test \
ctemp diffgolden clean
ctemp diffgolden clean cleandocs

help:
@echo "Help for command-line Org->Markdown for Hugo Exporter"
Expand All @@ -117,6 +117,7 @@ help:
@echo " make doc_gh <-- Build README.org and CONTRIBUTING.org for GitHub"
@echo " make hugo_test <-- Build the test site using Hugo"
@echo " make clean <-- Delete the Hugo public/ directory and auto-installed elisp packages"
@echo " make cleandocs <-- Delete the Markdown files in doc/content/"
@echo " make <-- Show this help"

# Note: The Org file from $(ORG_FILE) is loaded *after* the --eval
Expand Down Expand Up @@ -269,9 +270,11 @@ clean: ctemp
find $(OX_HUGO_TMP_DIR_BASE) -maxdepth 1 -type d -name ox-hugo-dev -exec rm -rf "{}" \;
find $(OX_HUGO_TEST_SITE_DIR) -maxdepth 1 -type d \( -name public -o -name content-golden -o -name content-modified \) -exec rm -rf "{}" \;
find ./doc -maxdepth 1 -type d -name public -exec rm -rf "{}" \;
find ./doc/content -name "*.md" -delete
rm -f ox-hugo-autoloads.el

cleandocs:
find ./doc/content -name "*.md" -delete

# Set a make variable during rule execution
# https://stackoverflow.com/a/1909390/1219634

Expand Down

0 comments on commit 6c6c0ba

Please sign in to comment.