Skip to content

Commit

Permalink
fix: Always print full path of the output file
Browse files Browse the repository at this point in the history
  • Loading branch information
TsekNet committed Apr 22, 2024
1 parent a6e33d3 commit 310c81e
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions cmd/gomls/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ func outputHTML(d helpers.Details) error {
return fmt.Errorf("failed to execute template: %w", err)
}

fmt.Printf("Wrote HTML file: %q\n", file)
path, err := filepath.Abs(file)
if err != nil {
return fmt.Errorf("failed to get absolute path of file: %w", err)
}

fmt.Printf("Wrote HTML file: %q\n", path)

return nil
}
Expand Down Expand Up @@ -254,7 +259,12 @@ func outputJSON(d helpers.Details) error {
return fmt.Errorf("failed to write JSON file: %w", err)
}

fmt.Printf("Wrote JSON file: %q\n", file)
path, err := filepath.Abs(file)
if err != nil {
return fmt.Errorf("failed to get absolute path of file: %w", err)
}

fmt.Printf("Wrote JSON file: %q\n", path)

return nil
}
Expand Down Expand Up @@ -350,7 +360,12 @@ func outputCSV(d helpers.Details) error {
return fmt.Errorf("failed to write CSV file: %w", err)
}

fmt.Printf("Wrote CSV file: %q\n", file)
path, err := filepath.Abs(file)
if err != nil {
return fmt.Errorf("failed to get absolute path of file: %w", err)
}

fmt.Printf("Wrote CSV file: %q\n", path)

return nil
}

0 comments on commit 310c81e

Please sign in to comment.