MCPcopy Create free account
hub / github.com/Silentely/eSIM-Tools / copyEntry

Function copyEntry

scripts/build-static.js:26–45  ·  view source on GitHub ↗
(entry)

Source from the content-addressed store, hash-verified

24}
25
26async function copyEntry(entry) {
27 const from = path.join(projectRoot, entry);
28 const to = path.join(distDir, entry);
29 if (!fs.existsSync(from)) {
30 console.warn(`⚠️ 跳过不存在的入口: ${entry}`);
31 return;
32 }
33 try {
34 const stats = await fs.promises.stat(from);
35 if (stats.isDirectory()) {
36 await copyDirectory(from, to);
37 } else {
38 await fs.promises.mkdir(path.dirname(to), { recursive: true });
39 await fs.promises.copyFile(from, to);
40 }
41 } catch (err) {
42 console.error(`❌ 复制失败 ${entry}:`, err.message);
43 throw err;
44 }
45}
46
47async function copyDirectory(source, destination) {
48 try {

Callers 1

build-static.jsFile · 0.85

Calls 3

copyDirectoryFunction · 0.85
warnMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected