feat: inject USER into shells (#1818)

This commit is contained in:
Garrett Delfosse
2022-05-26 18:01:47 -05:00
committed by GitHub
parent 951dc2d8b0
commit 1361c1357a
+1
View File
@@ -359,6 +359,7 @@ func (a *agent) createCommand(ctx context.Context, rawCommand string, env []stri
if err != nil {
return nil, xerrors.Errorf("getting os executable: %w", err)
}
cmd.Env = append(cmd.Env, fmt.Sprintf("USER=%s", username))
cmd.Env = append(cmd.Env, fmt.Sprintf(`PATH=%s%c%s`, os.Getenv("PATH"), filepath.ListSeparator, filepath.Dir(executablePath)))
// Git on Windows resolves with UNIX-style paths.
// If using backslashes, it's unable to find the executable.