fix(doctor): report config parse errors, remove redundant error in Execute
Doctor now checks configErr and emits a FAIL with the parse error and fix hint. Execute() no longer prints a separate error before running doctor — the doctor output is self-contained.
This commit is contained in:
parent
b4c89e7d90
commit
6ad6876051
2 changed files with 11 additions and 8 deletions
|
|
@ -23,7 +23,6 @@ THE SOFTWARE.
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
|
@ -41,8 +40,6 @@ func Execute() {
|
|||
if configErr != nil {
|
||||
cmd, _, _ := rootCmd.Find(os.Args[1:])
|
||||
if !configSafeCmd(cmd) {
|
||||
printError(fmt.Errorf("cannot load config: %v", configErr))
|
||||
fmt.Fprintln(os.Stderr)
|
||||
infof("Running pda! doctor")
|
||||
runDoctor(os.Stderr)
|
||||
os.Exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue