Skip to content

Commit 29f672f

Browse files
committed
chore: update scripts
1 parent e3a92e8 commit 29f672f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"lint": "run-p lint:eslint lint:markdownlint check:types",
4040
"lint:eslint": "eslint . --fix --cache",
4141
"lint:markdownlint": "markdownlint . --fix --ignore-path=.gitignore",
42-
"release": "bumpp --execute=\"tsx ./scripts/generate.ts\"",
42+
"release": "bumpp --all -x=\"tsx ./scripts/update-readme.ts\"",
4343
"prepare": "is-ci || husky install",
4444
"publish": "run-p publish:vscode publish:openvsx",
4545
"publish:vscode": "vsce package && vsce publish",

Diff for: scripts/generate.ts renamed to scripts/update-readme.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { readFileSync, writeFileSync } from 'node:fs';
22
import { resolve, dirname } from 'node:path';
33
import { fileURLToPath } from 'node:url';
4+
import { simpleGit } from 'simple-git';
45

56
const __dirname = dirname(fileURLToPath(import.meta.url));
67
const root = resolve(__dirname, '..');
8+
const readmePath = resolve(root, 'README.md');
79

810
const htmlObject = JSON.parse(
911
readFileSync(resolve(root, 'snippets', 'vue-html.json'), { encoding: 'utf8' }),
@@ -99,4 +101,6 @@ readme += `## 额外推荐
99101
请查看 [uni-helper 插件说明](https://marketplace.visualstudio.com/items?itemName=uni-helper.uni-helper-vscode)。
100102
`;
101103

102-
writeFileSync(resolve(root, 'README.md'), readme);
104+
writeFileSync(readmePath, readme);
105+
106+
await simpleGit().add(readmePath);

0 commit comments

Comments
 (0)