Skip to content

Commit

Permalink
Fixed plugin env not setting in direnv (#468)
Browse files Browse the repository at this point in the history
## 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`
  • Loading branch information
mohsenari authored Jan 13, 2023
1 parent 4fd7ba0 commit c7d47b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/boxcli/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func runShellCmd(cmd *cobra.Command, args []string, flags shellCmdFlags) error {
if err != nil {
return err
}
// print to stdout instead of stderr so that direnv can read the output
cmd.Print(script)
// explicitly print to stdout instead of stderr so that direnv can read the output
fmt.Fprint(cmd.OutOrStdout(), script)
// return here to prevent opening a devbox shell
return nil
}
Expand Down

0 comments on commit c7d47b1

Please sign in to comment.