MCPcopy
hub / github.com/wavetermdev/waveterm / getWaveDataDir

Function getWaveDataDir

emain/emain-platform.ts:131–149  ·  view source on GitHub ↗

* Gets the path to the directory where Wave data is stored. Creates the directory if it does not exist. * Handles backwards compatibility with the old Wave Home directory model, where configurations and data were stored together. * @returns The path where data should be stored.

()

Source from the content-addressed store, hash-verified

129 * @returns The path where data should be stored.
130 */
131function getWaveDataDir(): string {
132 // If wave home dir exists, use it for backwards compatibility
133 const waveHomeDir = getWaveHomeDir();
134 if (waveHomeDir) {
135 return waveHomeDir;
136 }
137
138 const override = process.env[WaveDataHomeVarName];
139 const xdgDataHome = process.env.XDG_DATA_HOME;
140 let retVal: string;
141 if (override) {
142 retVal = override;
143 } else if (xdgDataHome) {
144 retVal = path.join(xdgDataHome, waveDirName);
145 } else {
146 retVal = paths.data;
147 }
148 return ensurePathExists(retVal);
149}
150
151function getElectronAppBasePath(): string {
152 // import.meta.dirname in dev points to waveterm/dist/main

Callers 6

runWaveSrvFunction · 0.90
rotateLogIfNeededFunction · 0.90
emain-log.tsFile · 0.90
emain.tsFile · 0.90
getWaveSrvCwdFunction · 0.85
emain-platform.tsFile · 0.85

Calls 2

getWaveHomeDirFunction · 0.85
ensurePathExistsFunction · 0.85

Tested by

no test coverage detected