We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c392f6d commit 76271efCopy full SHA for 76271ef
v2/lastcmd.go
@@ -57,6 +57,11 @@ func saveCommand(cmd *exec.Cmd) error {
57
// Strip the leading /usr/bin/sh -c command, if present
58
commandString := getCommand(cmd)
59
60
+ // Add environment variables
61
+ for _, assignment := range cmd.Env {
62
+ commandString = assignment + " " + commandString
63
+ }
64
+
65
// Write the contents, ignore the number of written bytes
66
_, err = f.WriteString(fmt.Sprintf("#!/bin/sh\n%s\n", commandString))
67
return err
0 commit comments