-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqwik.js
More file actions
executable file
·37 lines (29 loc) · 903 Bytes
/
qwik.js
File metadata and controls
executable file
·37 lines (29 loc) · 903 Bytes
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
#!/usr/bin/env zx
import path from 'node:path';
import { createApp } from 'create-qwik';
import 'zx/globals';
await $`rm -rf qwik`;
await $`mkdir -p qwik`;
cd('qwik');
// const pwd = (await $`pwd`).stdout.trim();
const pwd = process.cwd();
const templates = ['basic', 'empty', 'site-with-visual-cms', 'library'];
// non-parallel version
// const failed = [];
// for (const template of templates) {
// try {
// await createApp({ starterId: template, outDir: path.join(pwd, template) });
// } catch {
// failed.push(template);
// }
// }
const results = await Promise.allSettled(
templates.map(template => createApp({ starterId: template, outDir: path.join(pwd, template) })),
);
const failed = results
.map((result, i) => (result.status === 'rejected' ? templates[i] : null))
.filter(x => x);
if (failed.length > 0) {
console.warn(`Failed templates: ${failed}`);
}
cd('..');