MCPcopy Index your code
hub / github.com/dotnet/vscode-csharp / createPackageAsync

Function createPackageAsync

tasks/packaging/vsceTasks.ts:13–60  ·  view source on GitHub ↗
(
    outputFolder: string,
    prerelease: boolean,
    packageName: string,
    vscodePlatformId?: string
)

Source from the content-addressed store, hash-verified

11
12/// Packaging (VSIX) Tasks
13export async function createPackageAsync(
14 outputFolder: string,
15 prerelease: boolean,
16 packageName: string,
17 vscodePlatformId?: string
18): Promise<string> {
19 const vsceArgs = [];
20 let packagePath = undefined;
21
22 if (!(await util.fileExists(vscePath))) {
23 throw new Error(`vsce does not exist at expected location: '${vscePath}'`);
24 }
25
26 vsceArgs.push(vscePath);
27 vsceArgs.push('package'); // package command
28
29 if (!fs.existsSync(outputFolder)) {
30 fs.mkdirSync(outputFolder);
31 }
32
33 vsceArgs.push('-o');
34 packagePath = path.join(outputFolder, packageName);
35 vsceArgs.push(packagePath);
36
37 if (vscodePlatformId !== undefined) {
38 vsceArgs.push('--target');
39 vsceArgs.push(vscodePlatformId);
40 }
41
42 if (prerelease) {
43 vsceArgs.push('--pre-release');
44 }
45
46 vsceArgs.push('--baseContentUrl', 'https://github.com/dotnet/vscode-csharp');
47
48 const spawnResult = await spawnNode(vsceArgs);
49 if (spawnResult.code != 0) {
50 throw new Error(`'${vsceArgs.join(' ')}' failed with code ${spawnResult.code}.`);
51 }
52
53 if (packagePath) {
54 if (!(await util.fileExists(packagePath))) {
55 throw new Error(`vsce failed to create: '${packagePath}'`);
56 }
57 }
58
59 return packagePath;
60}
61
62export async function generateVsixManifest(vsixPath: string) {
63 const vsceArgs = [];

Callers 1

buildVsixFunction · 0.90

Calls 2

spawnNodeFunction · 0.85
existsSyncMethod · 0.80

Tested by

no test coverage detected