MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / getWaveHomeDir

Function getWaveHomeDir

emain/emain-platform.ts:74–87  ·  view source on GitHub ↗

* Gets the path to the old Wave home directory (defaults to `~/.waveterm`). * @returns The path to the directory if it exists and contains valid data for the current app, otherwise null.

()

Source from the content-addressed store, hash-verified

72 * @returns The path to the directory if it exists and contains valid data for the current app, otherwise null.
73 */
74function getWaveHomeDir(): string {
75 let home = process.env[WaveHomeVarName];
76 if (!home) {
77 const homeDir = app.getPath("home");
78 if (homeDir) {
79 home = path.join(homeDir, `.${waveDirName}`);
80 }
81 }
82 // If home exists and it has `wave.lock` in it, we know it has valid data from Wave >=v0.8. Otherwise, it could be for WaveLegacy (<v0.8)
83 if (home && existsSync(home) && existsSync(path.join(home, "wave.lock"))) {
84 return home;
85 }
86 return null;
87}
88
89/**
90 * Ensure the given path exists, creating it recursively if it doesn't.

Callers 2

getWaveConfigDirFunction · 0.85
getWaveDataDirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected