Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/script/build/copyStaticAssets.ts
13389 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
6
import * as path from 'path';
7
import * as fs from 'fs';
8
9
const REPO_ROOT = path.join(__dirname, '..', '..');
10
11
export async function copyStaticAssets(srcpaths: string[], dst: string): Promise<void> {
12
await Promise.all(srcpaths.map(async srcpath => {
13
const src = path.join(REPO_ROOT, srcpath);
14
const dest = path.join(REPO_ROOT, dst, path.basename(srcpath));
15
await fs.promises.mkdir(path.dirname(dest), { recursive: true });
16
await fs.promises.copyFile(src, dest);
17
}));
18
}
19
20