Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/scripts/generate-definitelytyped.sh
3520 views
1
#!/usr/bin/env bash
2
3
if [ $# -eq 0 ]; then
4
echo "Pass in a version like ./scripts/generate-vscode-dts.sh 1.30."
5
echo "Failed to generate index.d.ts."
6
exit 1
7
fi
8
9
header="// Type definitions for Visual Studio Code ${1}
10
// Project: https://github.com/microsoft/vscode
11
// Definitions by: Visual Studio Code Team, Microsoft <https://github.com/microsoft>
12
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
13
14
/*---------------------------------------------------------------------------------------------
15
* Copyright (c) Microsoft Corporation. All rights reserved.
16
* Licensed under the MIT License.
17
* See https://github.com/microsoft/vscode/blob/main/LICENSE.txt for license information.
18
*--------------------------------------------------------------------------------------------*/
19
20
/**
21
* Type Definition for Visual Studio Code ${1} Extension API
22
* See https://code.visualstudio.com/api for more information
23
*/"
24
25
if [ -f ./src/vscode-dts/vscode.d.ts ]; then
26
echo "$header" > index.d.ts
27
sed "1,4d" ./src/vscode-dts/vscode.d.ts >> index.d.ts
28
echo "Generated index.d.ts for version ${1}."
29
else
30
echo "Can't find ./src/vscode-dts/vscode.d.ts. Run this script at vscode root."
31
fi
32
33