Skip to content

Commit bbe794f

Browse files
fix: use os.homedir() instead of process.env.HOME for cross-platform log directory (REBEL-RE)
process.env.HOME is empty on Windows, causing mkdirSync to use a relative path and crash Super-MCP on startup. os.homedir() returns USERPROFILE on Windows and HOME on macOS/Linux. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 47fccb3 commit bbe794f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/logging.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as fs from "fs";
2+
import * as os from "os";
23
import * as path from "path";
34

45
export type LogLevel = "debug" | "info" | "warn" | "error" | "fatal";
@@ -29,7 +30,7 @@ class Logger {
2930
this.level = level;
3031

3132
// Create logs directory
32-
const logsDir = path.join(process.env.HOME || "", ".super-mcp", "logs");
33+
const logsDir = path.join(os.homedir(), ".super-mcp", "logs");
3334
fs.mkdirSync(logsDir, { recursive: true, mode: 0o700 });
3435

3536
// Create log file with timestamp

0 commit comments

Comments
 (0)