File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use tempfile::NamedTempFile;
88use crate :: command:: create_command;
99use crate :: event:: Event ;
1010
11- /// send event to the spawned command process
11+ /// Send event to the spawned command process
1212// if hook command is not configured, this is not called
1313pub fn send_events ( command : & str , events : & [ Event ] ) {
1414 match serde_json:: to_string_pretty ( & events) {
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ cfg_if::cfg_if! {
3030 // so just copy the tempfile (path in EVENTS_FILE env var) to events.json
3131 const EVENTS_EXECUTABLE : & str = r#"@echo off
3232copy %EVENTS_FILE% events.json
33+ :: executables should clean up the temp file
34+ del %EVENTS_FILE%
3335"# ;
3436 const SCRIPT_FILENAME : & str = "write-events.bat" ;
3537 const VOLTA_BINARY : & str = "volta.exe" ;
@@ -43,6 +45,8 @@ while read line
4345do
4446 echo "$line" >>events.json
4547done
48+ # executables should clean up the temp file
49+ /bin/rm "$EVENTS_FILE"
4650"# ;
4751 const SCRIPT_FILENAME : & str = "write-events.sh" ;
4852 const VOLTA_BINARY : & str = "volta" ;
Original file line number Diff line number Diff line change @@ -58,13 +58,17 @@ cfg_if::cfg_if! {
5858 // copy the tempfile (path in EVENTS_FILE env var) to events.json
5959 const EVENTS_EXECUTABLE : & str = r#"@echo off
6060copy %EVENTS_FILE% events.json
61+ :: executables should clean up the temp file
62+ del %EVENTS_FILE%
6163"# ;
6264 const SCRIPT_FILENAME : & str = "write-events.bat" ;
6365 const YARN_SHIM : & str = "yarn.exe" ;
6466 } else if #[ cfg( unix) ] {
6567 // copy the tempfile (path in EVENTS_FILE env var) to events.json
6668 const EVENTS_EXECUTABLE : & str = r#"#!/bin/bash
6769/bin/cp "$EVENTS_FILE" events.json
70+ # executables should clean up the temp file
71+ /bin/rm "$EVENTS_FILE"
6872"# ;
6973 const SCRIPT_FILENAME : & str = "write-events.sh" ;
7074 const YARN_SHIM : & str = "yarn" ;
You can’t perform that action at this time.
0 commit comments