use interactive shell for environment

This commit is contained in:
sawka 2022-08-24 18:57:13 -07:00
parent 09a072f900
commit 8274d19e0b

View File

@ -1170,7 +1170,7 @@ func GetCurrentState() (string, []byte, error) {
return "", nil, fmt.Errorf("cannot find local mshell executable: %w", err) return "", nil, fmt.Errorf("cannot find local mshell executable: %w", err)
} }
ctx, _ := context.WithTimeout(context.Background(), GetStateTimeout) 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() outputBytes, err := ecmd.Output()
if err != nil { if err != nil {
errMsg := getStderr(err) errMsg := getStderr(err)