1- const fs = require ( ' fs-extra' ) ;
2- const path = require ( ' path' ) ;
1+ const fs = require ( " fs-extra" ) ;
2+ const path = require ( " path" ) ;
33
44async function syncComponent ( ) {
5- const sourceDir = path . join ( __dirname , ' ../apps/miniprogram-agent-ui/miniprogram/components/agent-ui' ) ;
6- const targetDir = path . join ( __dirname , ' ../components/agent-ui' ) ;
5+ const sourceDir = path . join ( __dirname , " ../apps/miniprogram-agent-ui/miniprogram/components/agent-ui" ) ;
6+ const targetDir = path . join ( __dirname , " ../components/agent-ui" ) ;
77
88 try {
9- console . log ( ' 🔄 同步组件文件...' ) ;
9+ console . log ( " 🔄 同步组件文件..." ) ;
1010 await fs . remove ( targetDir ) ;
1111 await fs . copy ( sourceDir , targetDir ) ;
1212
1313 // Git操作
14- const { execSync } = require ( ' child_process' ) ;
15- execSync ( ' git add .' ) ;
16- execSync ( 'git commit -m "chore: sync agent-ui component before release"' , { stdio : ' inherit' } ) ;
14+ const { execSync } = require ( " child_process" ) ;
15+ execSync ( " git add ." ) ;
16+ execSync ( 'git commit -m "chore: sync agent-ui component before release"' , { stdio : " inherit" } ) ;
1717
18- console . log ( ' ✅ 组件同步完成' ) ;
18+ console . log ( " ✅ 组件同步完成" ) ;
1919 } catch ( err ) {
20- console . error ( '❌ 同步失败:' , err ) ;
20+ console . log ( "err.message" , err . message ) ;
21+ console . error ( "❌ 同步失败:" , err ) ;
2122 process . exit ( 1 ) ;
2223 }
2324}
2425
25- syncComponent ( ) ;
26+ syncComponent ( ) ;
0 commit comments