Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
individual-it committed Dec 2, 2024
1 parent 5013adc commit 5483129
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/bill.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/Masterminds/sprig/v3"
"github.com/spf13/cobra"
"os"
"path/filepath"
"strings"
"text/template"
"time"
Expand Down Expand Up @@ -63,7 +64,7 @@ var billCmd = &cobra.Command{
startTime, _ := time.Parse("2006-01-02", startDate)
return startTime.Format("01/2006")
},
"AllTimeEntries": func(user string) []openproject.TimeEntry {
"AllTimeEntriesFromOpenProject": func(user string) []openproject.TimeEntry {
var openProjectUser openproject.User
openProjectUser, err := openproject.FindUserByName(config, user)
if err != nil {
Expand All @@ -83,7 +84,7 @@ var billCmd = &cobra.Command{
funcMap[i] = f
}

tmpl, err := template.New("bill").Funcs(funcMap).ParseFiles(tmplFile)
tmpl, err := template.New(filepath.Base(tmplFile)).Funcs(funcMap).ParseFiles(tmplFile)
if err != nil {
_, _ = fmt.Fprint(os.Stderr, fmt.Errorf("could not parse template file '%v': %v", tmplFile, err))
os.Exit(1)
Expand Down

0 comments on commit 5483129

Please sign in to comment.