-
-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathfixture-cwd.js
More file actions
22 lines (17 loc) · 590 Bytes
/
fixture-cwd.js
File metadata and controls
22 lines (17 loc) · 590 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import process from 'node:process';
import path from 'node:path';
import electron from 'electron';
import Store from './index.js';
// Prevent Electron from never exiting when an exception happens
process.on('uncaughtException', error => {
console.error('Exception:', error);
process.exit(1);
});
console.log(electron.app.getPath('userData'));
const store = new Store({cwd: 'foo'});
store.set('unicorn', '🦄');
console.log(store.path);
const store2 = new Store({cwd: path.join(import.meta.dirname, 'bar')});
store2.set('ava', '🚀');
console.log(store2.path);
electron.app.quit();