This template project is intended for tesing gomplate
for use with a GitHub Template.
The gomplate CLI must be installed and available on your PATH
.
For example, using go install
to install gomplate
:
go install github.com/hairyhenderson/gomplate/v3/cmd/gomplate@latest
Verify gomplate is successfully installed and available on your PATH
:
$ gomplate --version
gomplate version 0.0.0
-
Create a new repository in GitHub and select this template as the "Repository template".
-
After creating the new repository, clone it locally.
-
From the local repository root folder, create and switch to a new branch, for example
pr-init-template
:git switch -c pr-init-template
-
Modify the included
skeleton-data.yaml
input data file with the appropriate substitution values for the provided properties for your new project. -
Stash your input data file in case it is needed later to start over:
git stash store "$(git stash create)" -m "gomplate input data backup"
-
Run the following command to run gomplate, which will replace all contents of the current directory with the template output.
gomplate --verbose
-
If you need to start the templatization process over, reset the git index to origin/main.
NOTE: Backup files if necessary first, this will delete all local changes.
git reset --hard origin/main && git clean -dfx
The input data file can then be recovered from the stash to start over with.
git stash apply
-
-
When satisified with the results, commit, push, and create the first Pull Request!
git add -A git status git commit -m "ci: initial templatization" git push -u origin pr-init-template