Skip to content

Commit c7d47b1

Browse files
authored
Fixed plugin env not setting in direnv (#468)
## Summary cmd.print() was not printing in stdout. Therefore the output was not being picked up by `eval` in `.envrc` ## How was it tested? - `devbox init` - `devbox add nginx` - `echo $NGINX_CONFDIR`
1 parent 4fd7ba0 commit c7d47b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/boxcli/shell.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ func runShellCmd(cmd *cobra.Command, args []string, flags shellCmdFlags) error {
5555
if err != nil {
5656
return err
5757
}
58-
// print to stdout instead of stderr so that direnv can read the output
59-
cmd.Print(script)
58+
// explicitly print to stdout instead of stderr so that direnv can read the output
59+
fmt.Fprint(cmd.OutOrStdout(), script)
6060
// return here to prevent opening a devbox shell
6161
return nil
6262
}

0 commit comments

Comments
 (0)