Skip to content

Commit

Permalink
Merge pull request #617 from twpayne/fix-commit-message-template-path
Browse files Browse the repository at this point in the history
Fix commit message template path
  • Loading branch information
twpayne authored Mar 4, 2020
2 parents b03639b + eb0129f commit ce06ed9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
yaml "gopkg.in/yaml.v2"
)

const commitMessageTemplateAsset = "assets/templates/COMMIT_MESSAGE.tmpl"

type sourceVCSConfig struct {
Command string
AutoCommit bool
Expand Down Expand Up @@ -199,7 +201,7 @@ func (c *Config) autoCommit(vcs VCS) error {
if err != nil {
return err
}
commitMessageText, err := getAsset("templates/COMMIT_MESSAGE.tmpl")
commitMessageText, err := getAsset(commitMessageTemplateAsset)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

func TestAutoCommitCommitMessage(t *testing.T) {
commitMessageText, err := getAsset("assets/templates/COMMIT_MESSAGE.tmpl")
commitMessageText, err := getAsset(commitMessageTemplateAsset)
require.NoError(t, err)
commitMessageTmpl, err := template.New("commit_message").Funcs(sprig.HermeticTxtFuncMap()).Parse(string(commitMessageText))
require.NoError(t, err)
Expand Down

0 comments on commit ce06ed9

Please sign in to comment.