-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,20 @@ export README_FILE ?= README.md | |
export README_YAML ?= README.yaml | ||
|
||
export README_TEMPLATE_REPO_REMOTE_NAME ?= origin | ||
export README_TEMPLATE_REPO_ORG ?= $(lastword $(subst :, ,$(subst /,,$(dir $(shell git remote get-url $(README_TEMPLATE_REPO_REMOTE_NAME)))))) | ||
#export README_TEMPLATE_REPO_REMOTE ?= $(shell git remote get-url $(README_TEMPLATE_REPO_REMOTE_NAME)) | ||
export README_TEMPLATE_REPO_REMOTE ?= https://github.com/cloudposse/build-harness | ||
export README_TEMPLATE_REPO_REMOTE ?= [email protected]:cloudposse/build-harness.git | ||
|
||
# Parse https://github.com/... | ||
ifneq (,$(findstring https://,$(README_TEMPLATE_REPO_REMOTE))) | ||
export README_TEMPLATE_REPO_ORG ?= $(shell basename $(shell dirname $(README_TEMPLATE_REPO_REMOTE))) | ||
endif | ||
|
||
# Parse [email protected] | ||
ifneq (,$(findstring [email protected],$(README_TEMPLATE_REPO_REMOTE))) | ||
export README_TEMPLATE_REPO_ORG ?= $(lastword $(subst :, ,$(subst /,,$(dir $(README_TEMPLATE_REPO_REMOTE))))) | ||
endif | ||
|
||
export README_TEMPLATE_REPO ?= .github | ||
export README_TEMPLATE_REPO_REF ?= blob/main | ||
export README_TEMPLATE_REPO_PATH ?= README.md.gotmpl | ||
|
@@ -14,9 +27,8 @@ export README_INCLUDES ?= $(file://$(shell pwd)/?type=text/plain) | |
|
||
# Create the README.md.gotmpl, if none exists by fetching it from the organization's `.github` repository | ||
$(README_TEMPLATE_FILE): | ||
git remote get-url $(README_TEMPLATE_REPO_REMOTE_NAME) 1>&2 | ||
echo GitHub Org: $(README_TEMPLATE_REPO_ORG) 1>&2 | ||
echo curl -o $@ -fsSL '$(README_TEMPLATE_REPO_URL)' | ||
@echo GitHub Org: $(README_TEMPLATE_REPO_ORG) | ||
curl -o $@ -fsSL '$(README_TEMPLATE_REPO_URL)' | ||
|
||
## Alias for readme/build | ||
readme: readme/build | ||
|