(srcPaths: string[], chunk: boolean, makeSandboxMenuItemFile: boolean, definedSandboxesPath: string)
| 18 | } |
| 19 | |
| 20 | export async function buildSandboxes(srcPaths: string[], chunk: boolean, makeSandboxMenuItemFile: boolean, definedSandboxesPath: string): Promise<string[]> { |
| 21 | const chunkMode = chunk ? 'lazy' : 'eager'; |
| 22 | const homes = srcPaths.map(srcPath => resolvePath(srcPath)); |
| 23 | const sandboxes = findSandboxes(homes); |
| 24 | |
| 25 | if (makeSandboxMenuItemFile) { |
| 26 | await buildSandboxMenuItemFile(sandboxes); |
| 27 | } |
| 28 | const rootPath = resolvePath(definedSandboxesPath); |
| 29 | if (!existsSync(rootPath)) { |
| 30 | mkdirSync(rootPath); |
| 31 | } |
| 32 | return await buildSandboxFileContents(rootPath, sandboxes, chunkMode, writeSandboxContent).then(results => { |
| 33 | console.log('Successfully compiled sandbox files.'); |
| 34 | return results; |
| 35 | }); |
| 36 | } |
| 37 | |
| 38 | export function findSandboxes(homes: string[]): SandboxFileInformation[] { |
| 39 | const sandboxes = []; |
no test coverage detected