Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions app/cli/internal/trace/README.md

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions app/cli/internal/trace/copilot/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,25 @@ import (
// eventsFile is the name of the session event log in a session folder.
const eventsFile = "events.jsonl"

// copilotHomeDir returns the Copilot configuration folder: $COPILOT_HOME, or
// ~/.copilot. It returns "" when neither is known.
func copilotHomeDir() string {
if home := os.Getenv("COPILOT_HOME"); home != "" {
return home
}
userHome, err := os.UserHomeDir()
if err != nil {
return ""
}
return filepath.Join(userHome, ".copilot")
}

// sessionStateRoot returns the folder where Copilot keeps its sessions:
// $COPILOT_HOME/session-state, or ~/.copilot/session-state.
func sessionStateRoot() string {
home := os.Getenv("COPILOT_HOME")
home := copilotHomeDir()
if home == "" {
userHome, err := os.UserHomeDir()
if err != nil {
return ""
}
home = filepath.Join(userHome, ".copilot")
return ""
}
return filepath.Join(home, "session-state")
}
Expand Down
Loading
Loading