* Get the session storage directory
()
| 33 | * Get the session storage directory |
| 34 | */ |
| 35 | function 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 |
no outgoing calls
no test coverage detected