blob: 83f89f108acf2f7da3b0ff74cb56d360cea7b660 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import path from 'path';
import { remote } from 'electron';
import fs from 'fs-extra';
const { app } = remote;
export function getServicePartitionsDirectory() {
return path.join(app.getPath('userData'), 'Partitions');
}
export function removeServicePartitionDirectory(id = '', addServicePrefix = false) {
const servicePartition = path.join(getServicePartitionsDirectory(), `${addServicePrefix ? 'service-' : ''}${id}`);
return fs.remove(servicePartition);
}
export async function getServiceIdsFromPartitions() {
const files = await fs.readdir(getServicePartitionsDirectory());
return files.filter(n => n !== '__chrome_extension');
}
|