9p: drive SessionStore.Get from sessionStoreFiles map
Eliminates the explicit script name list — any entry in sessionStoreFiles beyond "new" and "idx" is automatically served from disk. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5bb1783808
commit
723d586678
|
|
@ -65,8 +65,10 @@ func (s *SessionStore) Get(name string) ([]byte, error) {
|
||||||
return []byte("name=\ncwd=\nbackend=\nmodel=\nagent=\n"), nil
|
return []byte("name=\ncwd=\nbackend=\nmodel=\nagent=\n"), nil
|
||||||
case "idx":
|
case "idx":
|
||||||
return s.index(), nil
|
return s.index(), nil
|
||||||
case "ls", "kill", "sh", "job", "q", "sched":
|
default:
|
||||||
return os.ReadFile(paths.CfgDir() + "/scripts/" + name)
|
if _, ok := sessionStoreFiles[name]; ok {
|
||||||
|
return os.ReadFile(paths.CfgDir() + "/scripts/" + name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("%s: not a readable file", name)
|
return nil, fmt.Errorf("%s: not a readable file", name)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in New Issue