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

Function getWaveConfigDir

emain/emain-platform.ts:106–124  ·  view source on GitHub ↗

* Gets the path to the directory where Wave configurations are 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 configurations should be stored

()

Source from the content-addressed store, hash-verified

104 * @returns The path where configurations should be stored.
105 */
106function getWaveConfigDir(): string {
107 // If wave home dir exists, use it for backwards compatibility
108 const waveHomeDir = getWaveHomeDir();
109 if (waveHomeDir) {
110 return path.join(waveHomeDir, "config");
111 }
112
113 const override = process.env[WaveConfigHomeVarName];
114 const xdgConfigHome = process.env.XDG_CONFIG_HOME;
115 let retVal: string;
116 if (override) {
117 retVal = override;
118 } else if (xdgConfigHome) {
119 retVal = path.join(xdgConfigHome, waveDirName);
120 } else {
121 retVal = path.join(app.getPath("home"), ".config", waveDirName);
122 }
123 return ensurePathExists(retVal);
124}
125
126/**
127 * Gets the path to the directory where Wave data is stored. Creates the directory if it does not exist.

Callers 4

runWaveSrvFunction · 0.90
getLaunchSettingsFunction · 0.90
emain.tsFile · 0.90
emain-platform.tsFile · 0.85

Calls 2

getWaveHomeDirFunction · 0.85
ensurePathExistsFunction · 0.85

Tested by

no test coverage detected