smoke: support --test-repo on windows

This commit is contained in:
Martin Aeschlimann 2019-07-12 20:48:41 +02:00
parent 3e08ce3fcc
commit 39e688381c

View file

@ -29,6 +29,7 @@ import { setup as setupDataMultirootTests } from './areas/multiroot/multiroot.te
import { setup as setupDataLocalizationTests } from './areas/workbench/localization.test';
import { setup as setupLaunchTests } from './areas/workbench/launch.test';
import { MultiLogger, Logger, ConsoleLogger, FileLogger } from './logger';
import { platform } from 'os';
if (!/^v10/.test(process.version)) {
console.error('Error: Smoketest must be run using Node 10. Currently running', process.version);
@ -156,7 +157,12 @@ async function setupRepository(): Promise<void> {
console.log('*** Copying test project repository:', opts['test-repo']);
rimraf.sync(workspacePath);
// not platform friendly
cp.execSync(`cp -R "${opts['test-repo']}" "${workspacePath}"`);
if (process.platform === 'win32') {
cp.execSync(`xcopy /E "${opts['test-repo']}" "${workspacePath}"\\*`);
} else {
cp.execSync(`cp -R "${opts['test-repo']}" "${workspacePath}"`);
}
} else {
if (!fs.existsSync(workspacePath)) {
console.log('*** Cloning test project repository...');