Skip to content

Commit

Permalink
fix: display full output path when generating a client with an output…
Browse files Browse the repository at this point in the history
… dir flag (#1285)
  • Loading branch information
tomfrew authored Nov 9, 2023
1 parent bad329e commit 8ff92d0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/program/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,17 @@ func (m *GenerateClientModel) renderGenerate() string {
parts := strings.Split(generatedFile.Path, "/")
prePath := filepath.Join(parts[0 : len(parts)-1]...)

if m.OutputDir != "" {
if prePath != "" {
prePath = fmt.Sprintf("%s/%s", m.OutputDir, prePath)
} else {
prePath = m.OutputDir
}
}

b.WriteString(
colors.Gray(
fmt.Sprintf("- %s/%s%s", prePath, colors.Cyan(functionName).String(), colors.Gray(".ts").String()),
fmt.Sprintf("%s/%s%s", prePath, colors.Cyan(functionName).String(), colors.Gray(".ts").String()),
).Highlight().String(),
)
b.WriteString("\n")
Expand Down

0 comments on commit 8ff92d0

Please sign in to comment.