Skip to content

Commit d6b6e9c

Browse files
akiffeyzioglukoddr
authored andcommitted
fix: misshandled erros on exec
fix: duplicated formatted error Signed-off-by: Akif Feyzioğlu <[email protected]>
1 parent c0f0ffe commit d6b6e9c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: cmd/create.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func runCreateCmd(cmd *cobra.Command, args []string) error {
116116
[]string{"init", "vite@latest", "frontend", "--", "--template", frontend},
117117
true,
118118
); err != nil {
119-
return cgapp.ShowError(err.Error())
119+
return err
120120
}
121121
}
122122

Diff for: pkg/cgapp/exec.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func ExecCommand(command string, options []string, silentMode bool) error {
3535

3636
// Start executing command.
3737
if errStart := cmd.Start(); errStart != nil {
38-
return ShowError(stderr.String())
38+
return ShowError(errStart.Error())
3939
}
4040

4141
// Create a new scanner and run goroutine func with output, if not in silent mode.
@@ -50,7 +50,7 @@ func ExecCommand(command string, options []string, silentMode bool) error {
5050

5151
// Wait for executing command.
5252
if errWait := cmd.Wait(); errWait != nil {
53-
return ShowError(stderr.String())
53+
return ShowError(errWait.Error())
5454
}
5555

5656
return nil

0 commit comments

Comments
 (0)