From 8274d19e0ba370de954b29ed40f419648fef31bb Mon Sep 17 00:00:00 2001 From: sawka Date: Wed, 24 Aug 2022 18:57:13 -0700 Subject: [PATCH] use interactive shell for environment --- pkg/shexec/shexec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/shexec/shexec.go b/pkg/shexec/shexec.go index dbfd35e96..7c463bc9d 100644 --- a/pkg/shexec/shexec.go +++ b/pkg/shexec/shexec.go @@ -1170,7 +1170,7 @@ func GetCurrentState() (string, []byte, error) { return "", nil, fmt.Errorf("cannot find local mshell executable: %w", err) } ctx, _ := context.WithTimeout(context.Background(), GetStateTimeout) - ecmd := exec.CommandContext(ctx, "bash", "-l", "-c", fmt.Sprintf("%s --env", shellescape.Quote(execFile))) + ecmd := exec.CommandContext(ctx, "bash", "-l", "-i", "-c", fmt.Sprintf("%s --env", shellescape.Quote(execFile))) outputBytes, err := ecmd.Output() if err != nil { errMsg := getStderr(err)