mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
if WAVETERM_HOME is set, use that in emain (#859)
This commit is contained in:
parent
718ebb8170
commit
a4bc0fa93b
@ -7,6 +7,8 @@ import path from "path";
|
|||||||
import { WaveDevVarName, WaveDevViteVarName } from "../frontend/util/isdev";
|
import { WaveDevVarName, WaveDevViteVarName } from "../frontend/util/isdev";
|
||||||
import * as keyutil from "../frontend/util/keyutil";
|
import * as keyutil from "../frontend/util/keyutil";
|
||||||
|
|
||||||
|
const WaveHomeVarName = "WAVETERM_HOME";
|
||||||
|
|
||||||
const isDev = !app.isPackaged;
|
const isDev = !app.isPackaged;
|
||||||
const isDevVite = isDev && process.env.ELECTRON_RENDERER_URL;
|
const isDevVite = isDev && process.env.ELECTRON_RENDERER_URL;
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
@ -37,6 +39,10 @@ ipcMain.on("get-host-name", (event) => {
|
|||||||
|
|
||||||
// must match golang
|
// must match golang
|
||||||
function getWaveHomeDir() {
|
function getWaveHomeDir() {
|
||||||
|
const override = process.env[WaveHomeVarName];
|
||||||
|
if (override) {
|
||||||
|
return override;
|
||||||
|
}
|
||||||
return path.join(os.homedir(), isDev ? ".waveterm-dev" : ".waveterm");
|
return path.join(os.homedir(), isDev ? ".waveterm-dev" : ".waveterm");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user