Skip to content

Commit

Permalink
refactor(scripts): fix script about update less variable (#781)
Browse files Browse the repository at this point in the history
  • Loading branch information
typistZxd authored Mar 2, 2022
1 parent 4f93917 commit 8680ef0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/components/tabs/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ order: 0
| `@tabs-selected-color` | `@color-primary` | - | - |
| `@tabs-hover-color` | `@color-primary-l10` | - | - |
| `@tabs-active-color` | `@color-primary-d10` | - | - |
| `@tabs-active-font-size` | `@font-size-md` | - | - |
| `@tabs-disabled-color` | `@color-graphite-l10` | - | - |
| `@tabs-nav-font-size` | `@font-size-md` | - | - |
| `@tabs-nav-background-color` | `@color-white` | - | - |
Expand Down
4 changes: 2 additions & 2 deletions scripts/gen/style-variable/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ function file2Array(fileContent: string) {
async function appendVariable(target: string, template: string) {
let targetContent = await readFile(target, 'utf-8')
if (targetContent.includes(insertBeginFlag)) {
targetContent = targetContent.replace(new RegExp(`${insertBeginFlag}(.|\\s)*${insertEndFlag}`), template) // 匹配原有的内容进行替换
targetContent = targetContent.replace(new RegExp(`${insertBeginFlag}(.|\\s)*?${insertEndFlag}`), template) // 匹配原有的内容进行替换
writeFile(target, targetContent, 'utf-8')
} else {
appendFile(target, `\n${template}`)
template.trim() && appendFile(target, `\n${template}`)
}
}

Expand Down

0 comments on commit 8680ef0

Please sign in to comment.