summaryrefslogtreecommitdiffstats
path: root/src/reader.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-05-07 16:58:17 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-05-07 16:58:17 +0900
commit4bedd33c593ab0cb750e17c42750048904fdf7fb (patch)
tree10ef749a51b1b947f5bb34eb154c5f992a50edbb /src/reader.go
parentc5fb0c43f9222e72ff00290162b68e34a8f0d5d7 (diff)
Refactor the code to remove global variables
Diffstat (limited to 'src/reader.go')
-rw-r--r--src/reader.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/reader.go b/src/reader.go
index 6092087e..99a609e2 100644
--- a/src/reader.go
+++ b/src/reader.go
@@ -86,11 +86,12 @@ func (r *Reader) terminate() {
r.mutex.Unlock()
}
-func (r *Reader) restart(command string, environ []string) {
+func (r *Reader) restart(command commandSpec, environ []string) {
r.event = int32(EvtReady)
r.startEventPoller()
- success := r.readFromCommand(command, environ)
+ success := r.readFromCommand(command.command, environ)
r.fin(success)
+ removeFiles(command.tempFiles)
}
func (r *Reader) readChannel(inputChan chan string) bool {