2024-09-25 23:43:05 +02:00
|
|
|
import fs from "fs";
|
|
|
|
import path from "path";
|
|
|
|
import { getWaveHomeDir } from "./platform";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get settings directly from the Wave Home directory on launch.
|
|
|
|
* Only use this when the app is first starting up. Otherwise, prefer the settings.GetFullConfig function.
|
|
|
|
* @returns The initial launch settings for the application.
|
|
|
|
*/
|
|
|
|
export function getLaunchSettings(): SettingsType {
|
|
|
|
const settingsPath = path.join(getWaveHomeDir(), "config", "settings.json");
|
|
|
|
try {
|
|
|
|
const settingsContents = fs.readFileSync(settingsPath, "utf8");
|
|
|
|
return JSON.parse(settingsContents);
|
2024-09-26 00:34:31 +02:00
|
|
|
} catch (_) {
|
|
|
|
// fail silently
|
2024-09-25 23:43:05 +02:00
|
|
|
}
|
|
|
|
}
|