Skip to content

Commit 65c86e1

Browse files
Add npm_lifecycle env vars for scripts
1 parent 1bc6726 commit 65c86e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

utils.go

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ func runScript(name string, args []string) error {
3939
env := os.Environ()
4040
env = append(env, fmt.Sprintf("PATH=%s:%s", strings.Join(binDirs, ":"), os.Getenv("PATH")))
4141

42+
if ok {
43+
env = append(env, fmt.Sprintf("npm_lifecycle_event=%s", name))
44+
env = append(env, fmt.Sprintf("npm_lifecycle_script=%s", name))
45+
}
46+
4247
commandArgs := strings.Join(append([]string{script}, args...), " ")
4348

4449
fmt.Printf("%s %s\n", green.Render("$"), gray.Render(name))

0 commit comments

Comments
 (0)