fix mount path: s/ → session/
This commit is contained in:
parent
6e94053c5b
commit
bccaf0096d
10
main.go
10
main.go
|
|
@ -33,7 +33,7 @@ func main() {
|
||||||
// agentBase returns the filesystem path to the active agent within a session.
|
// agentBase returns the filesystem path to the active agent within a session.
|
||||||
// Layout: s/{sid}/agent/{aid}/
|
// Layout: s/{sid}/agent/{aid}/
|
||||||
func agentBase(sid string) string {
|
func agentBase(sid string) string {
|
||||||
agentDir := filepath.Join(ollie, "s", sid, "agent")
|
agentDir := filepath.Join(ollie, "session", sid, "agent")
|
||||||
entries, err := os.ReadDir(agentDir)
|
entries, err := os.ReadDir(agentDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return filepath.Join(agentDir, "0") // fallback
|
return filepath.Join(agentDir, "0") // fallback
|
||||||
|
|
@ -69,7 +69,7 @@ func newSessionList() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sl *sessionList) refresh() {
|
func (sl *sessionList) refresh() {
|
||||||
data, err := os.ReadFile(filepath.Join(ollie, "s", "idx"))
|
data, err := os.ReadFile(filepath.Join(ollie, "session", "idx"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
sl.win.Errf("read idx: %v", err)
|
sl.win.Errf("read idx: %v", err)
|
||||||
return
|
return
|
||||||
|
|
@ -122,7 +122,7 @@ func (sl *sessionList) eventLoop() {
|
||||||
case 'x', 'X':
|
case 'x', 'X':
|
||||||
cmd := strings.TrimSpace(string(e.Text))
|
cmd := strings.TrimSpace(string(e.Text))
|
||||||
if cmd == "New" {
|
if cmd == "New" {
|
||||||
openFile(filepath.Join(ollie, "s", "new"))
|
openFile(filepath.Join(ollie, "session", "new"))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if cmd == "Kill" {
|
if cmd == "Kill" {
|
||||||
|
|
@ -153,7 +153,7 @@ func (sl *sessionList) eventLoop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func sessionExists(sid string) bool {
|
func sessionExists(sid string) bool {
|
||||||
_, err := os.Stat(filepath.Join(ollie, "s", sid))
|
_, err := os.Stat(filepath.Join(ollie, "session", sid))
|
||||||
return err == nil
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,7 +180,7 @@ func openChat(sid string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
winName := "ollie/sessions/" + sid
|
winName := "ollie/sessions/" + sid
|
||||||
if data, err := os.ReadFile(filepath.Join(ollie, "s", "idx")); err == nil {
|
if data, err := os.ReadFile(filepath.Join(ollie, "session", "idx")); err == nil {
|
||||||
for _, line := range strings.Split(string(data), "\n") {
|
for _, line := range strings.Split(string(data), "\n") {
|
||||||
fields := strings.Split(line, "\t")
|
fields := strings.Split(line, "\t")
|
||||||
if len(fields) >= 3 && fields[0] == sid {
|
if len(fields) >= 3 && fields[0] == sid {
|
||||||
|
|
|
||||||
Reference in New Issue