Skip to content

Commit

Permalink
Fix path to commit message template asset
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Mar 4, 2020
1 parent b03639b commit eb0129f
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 eb0129f

Please sign in to comment.