This is an automated email from the ASF dual-hosted git repository.
linkinstar pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git
The following commit(s) were added to refs/heads/dev by this push:
new 30bac18a fix: add signal exit on build failure
30bac18a is described below
commit 30bac18a85555dc9acfd18bce1783fe3f1eb8d7a
Author: Luffy <[email protected]>
AuthorDate: Fri Apr 25 14:38:04 2025 +0800
fix: add signal exit on build failure
---
cmd/command.go | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/cmd/command.go b/cmd/command.go
index 42a404fb..fe17713e 100644
--- a/cmd/command.go
+++ b/cmd/command.go
@@ -227,10 +227,11 @@ To run answer, use:
Time: Time,
})
if err != nil {
- fmt.Printf("build failed %v", err)
- } else {
- fmt.Printf("build new answer successfully
%s\n", buildOutput)
+ fmt.Printf("build failed %v\n", err)
+ os.Exit(1)
}
+
+ fmt.Printf("build new answer successfully %s\n",
buildOutput)
},
}
@@ -292,7 +293,7 @@ To run answer, use:
Long: `Merge i18n files from plugins to original i18n files.
It will overwrite the original i18n files`,
Run: func(_ *cobra.Command, _ []string) {
if err := cli.ReplaceI18nFilesLocal(i18nTargetPath);
err != nil {
- fmt.Printf("replace i18n files failed %v", err)
+ fmt.Printf("replace i18n files failed %v\n",
err)
} else {
fmt.Printf("replace i18n files successfully\n")
}
@@ -300,7 +301,7 @@ To run answer, use:
fmt.Printf("try to merge i18n files from %q to %q\n",
i18nSourcePath, i18nTargetPath)
if err := cli.MergeI18nFilesLocal(i18nTargetPath,
i18nSourcePath); err != nil {
- fmt.Printf("merge i18n files failed %v", err)
+ fmt.Printf("merge i18n files failed %v\n", err)
} else {
fmt.Printf("merge i18n files successfully\n")
}