Skip to content

Commit

Permalink
Adds help command
Browse files Browse the repository at this point in the history
Adds help command in make file.
  • Loading branch information
Hasmukh K Mistry authored and Robinlovelace committed Oct 13, 2021
1 parent 58e7339 commit 4b41771
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ html2:
# cp -fvr images _book/
cp -fvr _main* _book/

build:
build: ## Make Build
make html
Rscript -e 'browseURL("_book/index.html")'

pdf:
pdf: ## Render book in pdf
Rscript -e 'bookdown::render_book("index.Rmd", output_format = "bookdown::pdf_book")'

md:
md: ## Generate Markdown
Rscript -e 'bookdown::render_book("index.Rmd", output_format = "bookdown::pdf_book", clean = FALSE)'

install:
install: ## Perform install
Rscript -e 'remotes::install_github("Robinlovelace/geocompr")'

deploy:
deploy: ## Perform deployment
Rscript -e 'bookdown::publish_book(render = "local", account = "robinlovelace")'

clean:
Expand All @@ -36,3 +36,7 @@ cleaner:
rm -fvr *.html # rogue html files
rm -fvr *utf8.md # rogue md files

.PHONY: help
help: SHELL := /bin/sh
help: ## List available commands and their usage
@awk 'BEGIN {FS = ":.*?##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST)

0 comments on commit 4b41771

Please sign in to comment.