提交 1d4f8d6a 编写于 作者: P Pine Wu

Simplify type publisher

上级 65ae5c0a
......@@ -23,24 +23,20 @@ steps:
git config --global user.email "vscode@microsoft.com"
git config --global user.name "VSCode"
git clone https://github.com/octref/vscode-DefinitelyTyped.git --depth=1
cd vscode-DefinitelyTyped
git remote add dt https://github.com/DefinitelyTyped/DefinitelyTyped.git
git fetch dt master
git rebase dt/master
cd ..
git clone https://github.com/DefinitelyTyped/DefinitelyTyped.git
node build/azure-pipelines/publish-types/update-types.js
cd vscode-DefinitelyTyped
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
cd DefinitelyTyped
git diff --color | cat
git add -A
git status
git commit -m 'VS Code $TAG_VERSION Extension API'
git commit -m "VS Code $TAG_VERSION Extension API"
git push origin master
git remote add vscode https://${GITHUB_TOKEN}@github.com/octref/vscode-DefinitelyTyped.git
git push -f vscode master
displayName: Update vscode-DefinitelyTyped
......@@ -17,7 +17,7 @@ try {
.trim();
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vs/vscode.d.ts`;
const outPath = path.resolve(process.cwd(), 'vscode-DefinitelyTyped/types/vscode/index.d.ts');
const outPath = path.resolve(process.cwd(), 'DefinitelyTyped/types/vscode/index.d.ts');
cp.execSync(`curl ${dtsUri} --output ${outPath}`);
updateDTSFile(outPath, tag);
......@@ -48,8 +48,11 @@ function getNewFileContent(content: string, tag: string) {
}
function getNewFileHeader(tag: string) {
const [major, minor] = tag.split('.');
const shorttag = `${major}.${minor}`;
const header = [
`// Type definitions for Visual Studio Code ${tag}`,
`// Type definitions for Visual Studio Code ${shorttag}`,
`// Project: https://github.com/microsoft/vscode`,
`// Definitions by: Visual Studio Code Team, Microsoft <https://github.com/Microsoft>`,
`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`,
......@@ -61,7 +64,7 @@ function getNewFileHeader(tag: string) {
` *--------------------------------------------------------------------------------------------*/`,
``,
`/**`,
` * Type Definition for Visual Studio Code ${tag} Extension API`,
` * Type Definition for Visual Studio Code ${shorttag} Extension API`,
` * See https://code.visualstudio.com/api for more information`,
` */`
].join('\n');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册