Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,20 @@ TAB=$(shell printf "\t")
DEV_ROCKS = "busted" "luacheck" "ldoc" "luacov"


target_not_specified: help
target_not_specified:
ifneq (,$(wildcard ./init.sh))
@$(MAKE) init
else
@$(MAKE) help
endif
@exit 1


.PHONY: init
init:
@if [ -f ./init.sh ]; then ./init.sh; else echo "Already initialized. Run 'make help' for available targets."; fi


help:
@echo "Available make targets for ${ROCK_NAME}:"
@echo ""
Expand Down
2 changes: 1 addition & 1 deletion doc_topics/01-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Here's a list of things to do when using this template:

* Clone the repo locally.

* Run the interactive `init.sh` script.
* Run `make` and follow the interactive prompts to initialize the repo.

* Commit all changes, and push to the repo.

Expand Down
3 changes: 3 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

# No need to run this script manually; just run `make` and it will be
# invoked automatically on first use, and then deleted.

REPO_NAME=$(basename "$(git rev-parse --show-toplevel)")
GH_ACCOUNT=$(git remote -v | grep "(fetch)" | sed "s/ (fetch)//" | sed "s/^.*github.com\///" | sed "s/\/.*$//")
USER_NAME=$(git config user.name)
Expand Down
Loading