Skip to content

Commit

Permalink
Fix looking up file in home directory
Browse files Browse the repository at this point in the history
  • Loading branch information
carhartl committed Jun 5, 2023
1 parent 45517cd commit c005bde
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/command/set_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func findCoAuthor(s string, path string) string {
return s
}

if fileName, found := strings.CutPrefix(path, "$HOME/"); found {
home, _ := os.UserHomeDir()
path = home + "/" + fileName
}

f, err := os.Open(path)
if err != nil {
return ""
Expand Down

0 comments on commit c005bde

Please sign in to comment.