Skip to content
Source
Sign inSign up
pingdotgg/t3code

Isolate dev state and support forwarding server flags in dev runner #96

Mergedjuliusmarmingemerged 7 commits intomain fromcodething/9857e4f3merged by juliusmarminge View on GitHub

Showing 6 changed files with 51 additions and 17 deletions (loading 3).

x
0 of 6 viewed, 6 left
4 additions and 11 deletionsapps/desktop/src/main.tsModified
View file
@@ -5,16 +5,8 @@
import os from "node:os";
import path from "node:path";
​
-import {
- app,
- BrowserWindow,
- dialog,
- ipcMain,
- Menu,
- type MenuItemConstructorOptions,
- protocol,
- shell,
-} from "electron";
+import { app, BrowserWindow, dialog, ipcMain, Menu, protocol, shell } from "electron";
+import type { MenuItemConstructorOptions } from "electron";
​
import { showDesktopConfirmDialog } from "./confirmDialog";
import { fixPath } from "./fixPath";
@@ -26,7 +18,8 @@
const CONTEXT_MENU_CHANNEL = "desktop:context-menu";
const OPEN_EXTERNAL_CHANNEL = "desktop:open-external";
const MENU_ACTION_CHANNEL = "desktop:menu-action";
-const STATE_DIR = path.join(os.homedir(), ".t3", "userdata");
+const STATE_DIR =
+ process.env.T3CODE_STATE_DIR?.trim() || path.join(os.homedir(), ".t3", "userdata");
const DESKTOP_SCHEME = "t3";
const ROOT_DIR = path.resolve(__dirname, "../../..");
const isDevelopment = Boolean(process.env.VITE_DEV_SERVER_URL);