import * as fse from 'fs-extra' ; import * as path from 'path' ; import { ext } from '../../extension.bundle' ; import { logsFolder } from '../testConstants' ; import { writeToLog , writeToWarning } from './testLog' ; export async function publishVsCodeLogs ( extensionid ) { writeToLog ( `Copying the vscode logs for ${ extensionid ?? 'all' }...` ) ; const parentPath = path . dirname ( ext . context . logPath ) ; const sourcePath = path . join ( parentPath , extensionid ?? '..' ) ; const destFolderPath = path . join ( logsFolder , extensionid ?? 'all' ) ; await fse . mkdir ( destFolderPath ) ; if ( fse . pathExistsSync ( sourcePath ) ) { await fse . copy ( sourcePath , destFolderPath , { recursive : true , preserveTimestamps : true } ) ; } else { writeToWarning ( `  Log folder does not exist: ${ sourcePath }` ) ; } }