MCPcopy Create free account
hub / github.com/Explosion-Scratch/firebuilder / handle

Function handle

handlers/contentcss.js:7–35  ·  view source on GitHub ↗
({
  profilePath,
  modulesPath,
  options = {},
  enabled = [],
})

Source from the content-addressed store, hash-verified

5import { join } from "path";
6
7export default function handle({
8 profilePath,
9 modulesPath,
10 options = {},
11 enabled = [],
12}) {
13 let out = `/* ${defaultPrefs.preamble} */\n\n\n`;
14
15 for (let p of enabled) {
16 log.debug(`usercss: Enabling module ${p}`);
17 copyFilesToProfile(join(profilePath, "chrome", "content_css_files"), [
18 join(modulesPath, p),
19 ]);
20 }
21 copyFilesToProfile(join(profilePath, "chrome"), [
22 {
23 name: "userContent.css",
24 append: true,
25 content:
26 `/* ${defaultPrefs.preamble} */\n\n` +
27 enabled
28 .map(
29 (i) =>
30 `@import url(${JSON.stringify(`content_css_files/${i}`)});`
31 )
32 .join("\n"),
33 },
34 ]);
35}

Callers

nothing calls this directly

Calls 1

copyFilesToProfileFunction · 0.85

Tested by

no test coverage detected