okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-0243-gui into f-0243-rel (Chat.tsx and DropZone.tsx: the guifix clipboard helpers kept at the conflicts, copyAndTell stays for Markdown and Serving)061a28583

main
1.0 KiB19 linesraw
1/**
2 * Import this FIRST in a test that builds the host's native control or starts the host: it points the per-user places the host writes to
3 * (the settings file Control reads, the components folder, the app's local data) at a scratch folder.
4 * On 2026-10-24 a host test run rewrote the owner's real %LOCALAPPDATA%\Strata\app-settings.json (its data_dir became a deleted test folder).
5 */
6import { mkdtempSync } from 'node:fs';
7import { tmpdir } from 'node:os';
8import { join } from 'node:path';
9
10if (!process.env.STRATA_TEST_KEEP_PROFILE) {
11  const scratch = mkdtempSync(join(tmpdir(), 'strata-host-test-profile-'));
12  process.env.STRATA_SETTINGS_FILE = join(scratch, 'app-settings.json');
13  process.env.STRATA_COMPONENTS_DIR = join(scratch, 'components');
14  process.env.LOCALAPPDATA = join(scratch, 'Local');
15  process.env.APPDATA = join(scratch, 'Roaming');
16  process.env.XDG_DATA_HOME = join(scratch, 'xdg-data');
17  process.env.XDG_STATE_HOME = join(scratch, 'xdg-state');
18  process.env.XDG_CONFIG_HOME = join(scratch, 'xdg-config');
19}