Path: blob/main/extensions/copilot/script/build/copyStaticAssets.ts
13389 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import * as path from 'path';6import * as fs from 'fs';78const REPO_ROOT = path.join(__dirname, '..', '..');910export async function copyStaticAssets(srcpaths: string[], dst: string): Promise<void> {11await Promise.all(srcpaths.map(async srcpath => {12const src = path.join(REPO_ROOT, srcpath);13const dest = path.join(REPO_ROOT, dst, path.basename(srcpath));14await fs.promises.mkdir(path.dirname(dest), { recursive: true });15await fs.promises.copyFile(src, dest);16}));17}181920