Skip to content

Commit 8bce035

Browse files
authored
Update copyDist.js
1 parent 5b3e6f4 commit 8bce035

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

nodejs/copyDist.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
// Import required modules
1+
// 新添加用于支持DS源适配猫影视
2+
// 导入所需模块
23
import fs from 'fs';
34
import path from 'path';
45
import { execSync } from 'child_process';
56

6-
// Check if the destination path is provided
7+
// 检查是否提供了目标路径
78
if (process.argv.length < 3) {
89
console.error('Usage: node script.js <destination_path>');
910
process.exit(1);
1011
}
1112

12-
// Get the destination path from command-line arguments
13+
// 从命令行参数获取目标路径
1314
const destinationPath = process.argv[2];
1415

15-
// Resolve paths
16+
// 解析路径
1617
const distPath = path.resolve(process.cwd(), 'dist');
1718
const targetPath = path.resolve(destinationPath);
1819

19-
// Check if dist directory exists
20+
// 检查dist目录是否存在
2021
if (!fs.existsSync(distPath)) {
2122
console.error(`Source directory does not exist: ${distPath}`);
2223
process.exit(1);
2324
}
2425

25-
// Check if target directory exists
26+
// 检查目标目录是否存在
2627
if (!fs.existsSync(targetPath)) {
2728
console.error(`Target directory does not exist: ${targetPath}`);
2829
process.exit(1);
2930
}
3031

31-
// Copy files from dist to target
32+
// 将文件从dist复制到目标
3233
const copyFiles = (srcDir, destDir) => {
3334
const entries = fs.readdirSync(srcDir, { withFileTypes: true });
3435

0 commit comments

Comments
 (0)