Skip to content

Commit

Permalink
Merge branch 'main' of github.com:cncsc/template-stacks
Browse files Browse the repository at this point in the history
  • Loading branch information
lukiffer committed Jan 18, 2023
2 parents a72ad1c + 2e59652 commit 052447e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .init-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -48,8 +49,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"
Expand All @@ -59,6 +60,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
Expand Down
3 changes: 2 additions & 1 deletion .tools/verify-tfc-workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 052447e

Please sign in to comment.