Skip to content

Commit

Permalink
Resolve relative paths and pass resolved paths
Browse files Browse the repository at this point in the history
  • Loading branch information
felixjung authored and daveshanley committed Oct 22, 2024
1 parent 8d5c8cd commit 32a921a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,14 @@ func GetReportCommand() *cobra.Command {
}

if f.IsDir() {

repo := p
if !path.IsAbs(repo) {
wd, err := os.Getwd()
if err != nil {
return fmt.Errorf("get working dir: %v", err)
}
repo = filepath.Join(wd, repo)
}
p = args[1]
f, err = os.Stat(filepath.Join(repo, p))
if err != nil {
Expand All @@ -154,7 +160,7 @@ func GetReportCommand() *cobra.Command {

go listenForUpdates(updateChan, errorChan)

report, er := runGitHistoryReport(args[0], args[1], latestFlag, updateChan, errorChan, baseFlag,
report, er := runGitHistoryReport(repo, p, latestFlag, updateChan, errorChan, baseFlag,
remoteFlag, globalRevisionsFlag, limitFlag, limitTimeFlag)

<-doneChan
Expand Down

0 comments on commit 32a921a

Please sign in to comment.