From 538519ea92c1492e0464845f28c37cc5e8235b72 Mon Sep 17 00:00:00 2001 From: Luke Fritz Date: Fri, 23 Dec 2022 17:39:26 -0600 Subject: [PATCH 1/3] Update template initialization script (patch) --- .init-template.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.init-template.sh b/.init-template.sh index 81e3ff2..f97c4e2 100755 --- a/.init-template.sh +++ b/.init-template.sh @@ -25,7 +25,7 @@ function update_package_json() { function update_github_env_file() { local -r github_org="$1" - eval "$SED_COMMAND 's/cncsc/$github_org/g ./github/env.yaml" + eval "$SED_COMMAND 's/cncsc/$github_org/g' ./github/env.yaml" } function update_remote_state_config() { @@ -48,8 +48,8 @@ function main() { read -r description done - remote_origin="$(git config --get remote.origin.url || true)" - github_org="$(dirname "$remote_origin")" + repo="$(git config --get remote.origin.url | sed 's/.*://')" + github_org="$(dirname "$repo")" update_package_json "$github_org" "$repository_name" "$description" update_github_env_file "$github_org" @@ -59,6 +59,7 @@ function main() { echo "" echo "Initialization complete. Committing to source control..." + pre-commit install git add -A git commit -m "Initialize repository from template" git push -u origin main From d2327e6291203a9e9928857c85e9278c3426408f Mon Sep 17 00:00:00 2001 From: Luke Fritz Date: Sat, 31 Dec 2022 13:59:05 -0600 Subject: [PATCH 2/3] Fix display issue in TFC validation script (fix) --- .tools/verify-tfc-workspace.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.tools/verify-tfc-workspace.sh b/.tools/verify-tfc-workspace.sh index 60c7de9..f2aa8ec 100644 --- a/.tools/verify-tfc-workspace.sh +++ b/.tools/verify-tfc-workspace.sh @@ -65,8 +65,9 @@ function validate_workspace() { echo "- Updating workspace execution mode to local..." set_execution_mode_local "$tfc_api_token" "$organization" "$workspace" echo "- Workspace execution mode updated to to local." - echo "" fi + + echo "" } function main() { From 2e59652d1f7994783607ec5253e1f573f253a5ff Mon Sep 17 00:00:00 2001 From: Luke Fritz Date: Sat, 31 Dec 2022 21:36:58 -0600 Subject: [PATCH 3/3] Adjust GitHub directory structure (patch) --- .init-template.sh | 3 ++- github/{ => .template}/env.hcl | 0 github/{ => .template}/env.yaml | 0 3 files changed, 2 insertions(+), 1 deletion(-) rename github/{ => .template}/env.hcl (100%) rename github/{ => .template}/env.yaml (100%) diff --git a/.init-template.sh b/.init-template.sh index f97c4e2..c574719 100755 --- a/.init-template.sh +++ b/.init-template.sh @@ -25,7 +25,8 @@ function update_package_json() { function update_github_env_file() { local -r github_org="$1" - eval "$SED_COMMAND 's/cncsc/$github_org/g' ./github/env.yaml" + mv "./github/.template" "./github/$github_org" + eval "$SED_COMMAND 's/cncsc/$github_org/g' ./github/$github_org/env.yaml" } function update_remote_state_config() { diff --git a/github/env.hcl b/github/.template/env.hcl similarity index 100% rename from github/env.hcl rename to github/.template/env.hcl diff --git a/github/env.yaml b/github/.template/env.yaml similarity index 100% rename from github/env.yaml rename to github/.template/env.yaml