From 8ff92d0c5009e4baedf3653599ba3704f79a63cf Mon Sep 17 00:00:00 2001 From: tomfrew Date: Thu, 9 Nov 2023 02:18:19 +0000 Subject: [PATCH] fix: display full output path when generating a client with an output dir flag (#1285) --- cmd/program/client.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/program/client.go b/cmd/program/client.go index 82a2c99d5..59cd5727e 100644 --- a/cmd/program/client.go +++ b/cmd/program/client.go @@ -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")