-
Notifications
You must be signed in to change notification settings - Fork 0
/
copy-assets.mjs
66 lines (62 loc) · 3.2 KB
/
copy-assets.mjs
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import fs from "node:fs/promises";
import path from "node:path";
const assets = Object.freeze([
"node_modules/@artichokeruby/logo/favicons/favicon-32x32.png",
"node_modules/@artichokeruby/logo/favicons/favicon-128x128.png",
"node_modules/@artichokeruby/logo/favicons/favicon-192x192.png",
"node_modules/@artichokeruby/logo/favicons/favicon-196x196.png",
"node_modules/@artichokeruby/logo/favicons/favicon-152x152.png",
"node_modules/@artichokeruby/logo/favicons/favicon-180x180.png",
"node_modules/@artichokeruby/logo/favicons/safari-pinned-tab.svg",
"node_modules/@artichokeruby/logo/favicons/mstile-150x150.png",
"node_modules/@artichokeruby/logo/optimized/artichoke-logo.png",
"node_modules/@artichokeruby/logo/optimized/artichoke-logo.svg",
"node_modules/@artichokeruby/logo/optimized/artichoke-logo-inverted.png",
"node_modules/@artichokeruby/logo/optimized/artichoke-logo-inverted.svg",
"node_modules/@artichokeruby/logo/optimized/artichoke-playground-safari-revision-4938-dark-mode.png",
"node_modules/@artichokeruby/logo/optimized/artichoke-playground-safari-revision-4938-light-mode.png",
"node_modules/@artichokeruby/logo/optimized/artichoke-playground-social-safari-revision-4938-dark-mode.png",
"node_modules/@artichokeruby/logo/optimized/artichoke-playground-social-safari-revision-4938-light-mode.png",
"node_modules/@artichokeruby/logo/optimized/artichoke-social-logo.png",
"node_modules/@artichokeruby/logo/optimized/artichoke-social-logo.svg",
"node_modules/@artichokeruby/logo/optimized/artichoke-social-profile.png",
"node_modules/@artichokeruby/logo/optimized/artichoke-social-profile.svg",
"node_modules/@artichokeruby/logo/optimized/mark-black.svg",
"node_modules/@artichokeruby/logo/optimized/mark-color.svg",
"node_modules/@artichokeruby/logo/optimized/mark-green.svg",
"node_modules/@artichokeruby/logo/optimized/mark-white.svg",
"node_modules/@artichokeruby/logo/optimized/nav-black.svg",
"node_modules/@artichokeruby/logo/optimized/nav-color.svg",
"node_modules/@artichokeruby/logo/optimized/nav-green.svg",
"node_modules/@artichokeruby/logo/optimized/nav-white.svg",
"node_modules/@artichokeruby/logo/optimized/playground.png",
"node_modules/@artichokeruby/logo/optimized/playground-social-logo.png",
"node_modules/@artichokeruby/logo/optimized/wordmark-black.svg",
"node_modules/@artichokeruby/logo/optimized/wordmark-color.svg",
"node_modules/@artichokeruby/logo/optimized/wordmark-green.svg",
"node_modules/@artichokeruby/logo/optimized/wordmark-white.svg",
"node_modules/@artichokeruby/logo/social/twitter-logo-black.svg",
"node_modules/@artichokeruby/logo/social/github-logo.svg",
"node_modules/@artichokeruby/logo/social/discord-logo.svg",
]);
const build = async () => {
await fs.mkdir("public/social", { recursive: true });
await Promise.all(
assets.map(async (asset) => {
const file = path.basename(asset);
if (asset.includes("/social/")) {
await fs.copyFile(asset, path.join("public", "social", file));
} else {
await fs.copyFile(asset, path.join("public", file));
}
}),
);
};
(async function main() {
try {
await build();
} catch (error) {
console.error(error);
process.exit(1);
}
})();