From 8fe14aa11fbec925e028ae971b6747798faa90e2 Mon Sep 17 00:00:00 2001 From: Erik Osterman Date: Thu, 25 Jan 2024 14:54:43 -0600 Subject: [PATCH] test fix --- modules/readme/Makefile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/modules/readme/Makefile b/modules/readme/Makefile index 10ac4997..6fdd4c07 100644 --- a/modules/readme/Makefile +++ b/modules/readme/Makefile @@ -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 ?= git@github.com: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 git@github.com +ifneq (,$(findstring git@github.com,$(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