-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanagers.ts
More file actions
37 lines (33 loc) · 1.27 KB
/
managers.ts
File metadata and controls
37 lines (33 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { ConfigInterface, ConfigLocal, isTests, ManagerLocal, RegistryType } from '@open-audio-stack/core';
import path from 'path';
export const CONFIG: ConfigInterface = {
registries: [
{
name: 'Open Audio Registry',
url: 'https://open-audio-stack.github.io/open-audio-stack-registry',
},
],
version: '1.0.0',
};
export const CONFIG_LOCAL_TEST: ConfigInterface = {
...CONFIG,
appDir: 'test',
pluginsDir: path.join('test', 'installed', 'plugins'),
presetsDir: path.join('test', 'installed', 'presets'),
projectsDir: path.join('test', 'installed', 'projects'),
};
export const config: ConfigLocal = new ConfigLocal(isTests() ? CONFIG_LOCAL_TEST : undefined);
config.logEnable();
console.log('appDir', config.get('appDir'));
console.log('pluginsDir', config.get('pluginsDir'));
console.log('presetsDir', config.get('presetsDir'));
console.log('projectsDir', config.get('projectsDir'));
export const managers: Record<string, ManagerLocal> = {};
const types = [RegistryType.Plugins, RegistryType.Presets, RegistryType.Projects];
for (const type of types) {
const manager: ManagerLocal = new ManagerLocal(type as RegistryType, isTests() ? CONFIG_LOCAL_TEST : undefined);
manager.logEnable();
await manager.sync();
manager.scan();
managers[type] = manager;
}