diff options
Diffstat (limited to 'runner/shell')
| -rw-r--r-- | runner/shell/shell.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/runner/shell/shell.go b/runner/shell/shell.go index c9d7134..3c4bddb 100644 --- a/runner/shell/shell.go +++ b/runner/shell/shell.go @@ -13,6 +13,7 @@ import ( "pik/spool" "slices" "strings" + "sync" ) //TODO: Clean up shell selection? Maybe default to bash? @@ -33,6 +34,7 @@ var Runner = &shell{ type shell struct { Locations map[string]string + lock sync.Mutex } func (s *shell) Wants(f fs.FS, file string, entry fs.DirEntry) (bool, error) { @@ -67,7 +69,9 @@ func (s *shell) Find(shell string) (string, error) { } if p, err := exec.LookPath(shell); err == nil { + s.lock.Lock() s.Locations[shell] = p + s.lock.Unlock() return shell, nil } else { return "", err |
