File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1- // Import required modules
1+ // 新添加用于支持DS源适配猫影视
2+ // 导入所需模块
23import fs from 'fs' ;
34import path from 'path' ;
45import { execSync } from 'child_process' ;
56
6- // Check if the destination path is provided
7+ // 检查是否提供了目标路径
78if ( 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+ // 从命令行参数获取目标路径
1314const destinationPath = process . argv [ 2 ] ;
1415
15- // Resolve paths
16+ // 解析路径
1617const distPath = path . resolve ( process . cwd ( ) , 'dist' ) ;
1718const targetPath = path . resolve ( destinationPath ) ;
1819
19- // Check if dist directory exists
20+ // 检查dist目录是否存在
2021if ( ! 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+ // 检查目标目录是否存在
2627if ( ! 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复制到目标
3233const copyFiles = ( srcDir , destDir ) => {
3334 const entries = fs . readdirSync ( srcDir , { withFileTypes : true } ) ;
3435
You can’t perform that action at this time.
0 commit comments