Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/npm/mixin-telemetry-docs.ts
4770 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
import { execSync } from 'child_process';
6
import { join, resolve } from 'path';
7
import { existsSync, rmSync } from 'fs';
8
9
const rootPath = resolve(import.meta.dirname, '..', '..');
10
const telemetryDocsPath = join(rootPath, 'vscode-telemetry-docs');
11
const repoUrl = 'https://github.com/microsoft/vscode-telemetry-docs';
12
13
console.log('Cloning vscode-telemetry-docs repository...');
14
15
// Remove existing directory if it exists
16
if (existsSync(telemetryDocsPath)) {
17
console.log('Removing existing vscode-telemetry-docs directory...');
18
rmSync(telemetryDocsPath, { recursive: true, force: true });
19
}
20
21
try {
22
// Clone the repository (shallow clone of main branch only)
23
console.log(`Cloning ${repoUrl} to ${telemetryDocsPath}...`);
24
execSync(`git clone --depth 1 --branch main --single-branch ${repoUrl} vscode-telemetry-docs`, {
25
cwd: rootPath,
26
stdio: 'inherit'
27
});
28
29
console.log('Successfully cloned vscode-telemetry-docs repository.');
30
} catch (error) {
31
console.error('Failed to clone vscode-telemetry-docs repository:', (error as Error).message);
32
process.exit(1);
33
}
34
35