blob: f27d532852468ab5ea47d4efd9fface2363593c8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import { readdirSync, removeSync } from 'fs-extra';
import { userDataPath } from '../environment-remote';
export function getServicePartitionsDirectory(...segments) {
return userDataPath('Partitions', ...[segments].flat());
}
export function removeServicePartitionDirectory(
id = '',
addServicePrefix = false,
) {
const servicePartition = getServicePartitionsDirectory(
`${addServicePrefix ? 'service-' : ''}${id}`,
);
removeSync(servicePartition);
}
export async function getServiceIdsFromPartitions() {
const files = readdirSync(getServicePartitionsDirectory());
return files.filter(n => n !== '__chrome_extension');
}
|