@@ -5,12 +5,12 @@ const changeTheme = () => {
55 const THEMES = {
66 dark : 'dark' ,
77 light : 'light' ,
8- bpit : 'bpit_light ' ,
9- bpit_dark : 'bpit_dark ' ,
10- cloud_dark : 'cloud_dark ' ,
11- cloud : 'cloud_light ' ,
12- hdesign : 'hdesign_light ' ,
13- hdesign_dark : 'hdesign_dark '
8+ bpit : 'bpit-light ' ,
9+ bpit_dark : 'bpit-dark ' ,
10+ cloud_dark : 'cloud-dark ' ,
11+ cloud : 'cloud-light ' ,
12+ hdesign : 'hdesign-light ' ,
13+ hdesign_dark : 'hdesign-dark '
1414 }
1515
1616 // 获取命令行参数
@@ -22,19 +22,13 @@ const changeTheme = () => {
2222 }
2323
2424 // 你想要替换的文件
25- const filePath = path . join (
26- __dirname ,
27- '../../../../../packages/vue/src/huicharts/huicharts-core/src/chart-core.ts'
28- )
25+ const filePath = path . join ( __dirname , '../../../../../packages/vue/src/huicharts/huicharts-core/src/chart-core.ts' )
2926
3027 // 读取文件内容
3128 let content = fs . readFileSync ( filePath , 'utf-8' )
3229
3330 // 替换 process.env.VAR_NAME 为对应主题的值
34- content = content . replace (
35- / o p t i o n \. t h e m e \s = \s ' [ a - z A - Z _ ] + ' / g,
36- `option.theme = '${ theme } '`
37- )
31+ content = content . replace ( / o p t i o n \. t h e m e \s = \s ' [ a - z A - Z _ ] + ' / g, `option.theme = '${ theme } '` )
3832
3933 // 写入新内容到文件
4034 fs . writeFileSync ( filePath , content , 'utf-8' )
0 commit comments