@@ -5,12 +5,12 @@ const changeTheme = () => {
5
5
const THEMES = {
6
6
dark : 'dark' ,
7
7
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 '
14
14
}
15
15
16
16
// 获取命令行参数
@@ -22,19 +22,13 @@ const changeTheme = () => {
22
22
}
23
23
24
24
// 你想要替换的文件
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' )
29
26
30
27
// 读取文件内容
31
28
let content = fs . readFileSync ( filePath , 'utf-8' )
32
29
33
30
// 替换 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 } '` )
38
32
39
33
// 写入新内容到文件
40
34
fs . writeFileSync ( filePath , content , 'utf-8' )
0 commit comments