@@ -18,7 +18,6 @@ import (
18
18
"github.com/pkg/errors"
19
19
"go.jetpack.io/devbox/internal/boxcli/featureflag"
20
20
"go.jetpack.io/devbox/internal/boxcli/usererr"
21
- "go.jetpack.io/devbox/internal/redact"
22
21
23
22
"go.jetpack.io/devbox/internal/debug"
24
23
)
@@ -82,22 +81,15 @@ func (*Nix) PrintDevEnv(ctx context.Context, args *PrintDevEnvArgs) (*PrintDevEn
82
81
if insecure , insecureErr := IsExitErrorInsecurePackage (err , "" /*installable*/ ); insecure {
83
82
return nil , insecureErr
84
83
} else if err != nil {
85
- safeArgs := make ([]string , 0 , len (cmd .Args ))
86
- for _ , a := range cmd .Args {
87
- if a == args .FlakeDir {
88
- a = "<redacted path>"
89
- }
90
- safeArgs = append (safeArgs , a )
91
- }
92
- return nil , redact .Errorf ("nix command: %s" , redact .Safe (safeArgs ))
84
+ return nil , errors .Wrapf (err , "Command: %s" , cmd )
93
85
}
94
86
95
87
if err := json .Unmarshal (data , & out ); err != nil {
96
- return nil , redact . Errorf ( "unmarshal nix print-dev-env output: %w" , redact . Safe ( err ) )
88
+ return nil , errors . WithStack ( err )
97
89
}
98
90
99
91
if err = savePrintDevEnvCache (args .PrintDevEnvCachePath , out ); err != nil {
100
- return nil , redact . Errorf ( "savePrintDevEnvCache: %w" , redact . Safe ( err ) )
92
+ return nil , errors . WithStack ( err )
101
93
}
102
94
}
103
95
@@ -188,13 +180,12 @@ func Version() (string, error) {
188
180
cmd := command ("--version" )
189
181
outBytes , err := cmd .Output ()
190
182
if err != nil {
191
- return "" , redact . Errorf ( "nix command: %s" , redact . Safe ( cmd ) )
183
+ return "" , errors . WithStack ( err )
192
184
}
193
185
out := string (outBytes )
194
186
const prefix = "nix (Nix) "
195
187
if ! strings .HasPrefix (out , prefix ) {
196
- return "" , redact .Errorf (`nix command %s: expected %q prefix, but output was: %s` ,
197
- redact .Safe (cmd ), redact .Safe (prefix ), redact .Safe (out ))
188
+ return "" , errors .Errorf (`Expected "%s" prefix, but output from nix --version was: %s` , prefix , out )
198
189
}
199
190
version = strings .TrimSpace (strings .TrimPrefix (out , prefix ))
200
191
return version , nil
0 commit comments