We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3657d06 commit a1bf14fCopy full SHA for a1bf14f
internal/cli/config/get.go
@@ -17,7 +17,6 @@ package config
17
18
import (
19
"encoding/json"
20
- "fmt"
21
"os"
22
23
"github.com/arduino/arduino-cli/commands/daemon"
@@ -26,6 +25,7 @@ import (
26
25
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
27
"github.com/sirupsen/logrus"
28
"github.com/spf13/cobra"
+ "gopkg.in/yaml.v3"
29
)
30
31
func initGetCommand() *cobra.Command {
@@ -77,5 +77,10 @@ func (gr getResult) Data() interface{} {
77
}
78
79
func (gr getResult) String() string {
80
- return fmt.Sprintf("%v", gr.resp)
+ gs, err := yaml.Marshal(gr.resp)
81
+ if err != nil {
82
+ // Should never happen
83
+ panic(tr("unable to marshal config to YAML: %v", err))
84
+ }
85
+ return string(gs)
86
0 commit comments