MCPcopy Index your code
hub / github.com/continuedev/continue / getSessionDir

Function getSessionDir

extensions/cli/src/session.ts:35–59  ·  view source on GitHub ↗

* Get the session storage directory

()

Source from the content-addressed store, hash-verified

33 * Get the session storage directory
34 */
35function getSessionDir(): string {
36 // For tests, use the test directory if we're in test mode
37 if (process.env.CONTINUE_CLI_TEST && process.env.HOME) {
38 const sessionDir = path.join(process.env.HOME, ".continue", "sessions");
39
40 // Create directory if it doesn't exist
41 if (!fs.existsSync(sessionDir)) {
42 fs.mkdirSync(sessionDir, { recursive: true });
43 }
44
45 return sessionDir;
46 }
47
48 // Use CONTINUE_GLOBAL_DIR if set (for testing)
49 const continueHome =
50 process.env.CONTINUE_GLOBAL_DIR || path.join(os.homedir(), ".continue");
51 const sessionDir = path.join(continueHome, "sessions");
52
53 // Create directory if it doesn't exist
54 if (!fs.existsSync(sessionDir)) {
55 fs.mkdirSync(sessionDir, { recursive: true });
56 }
57
58 return sessionDir;
59}
60
61/**
62 * Get the session file path for the current session

Callers 5

getSessionFilePathFunction · 0.85
loadSessionFunction · 0.85
clearSessionFunction · 0.85
hasSessionFunction · 0.85
listSessionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected