mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 17:32:41 +00:00
smoke - fail early if cloning fails
This commit is contained in:
parent
c6bd448948
commit
f90dd46fc3
|
@ -218,12 +218,15 @@ async function setupRepository(): Promise<void> {
|
|||
} else {
|
||||
if (!fs.existsSync(workspacePath)) {
|
||||
logger.log('Cloning test project repository...');
|
||||
cp.spawnSync('git', ['clone', testRepoUrl, workspacePath]);
|
||||
const res = cp.spawnSync('git', ['clone', testRepoUrl, workspacePath], { stdio: 'inherit' });
|
||||
if (!fs.existsSync(workspacePath)) {
|
||||
throw new Error(`Clone operation failed: ${res.stderr.toString()}`);
|
||||
}
|
||||
} else {
|
||||
logger.log('Cleaning test project repository...');
|
||||
cp.spawnSync('git', ['fetch'], { cwd: workspacePath });
|
||||
cp.spawnSync('git', ['reset', '--hard', 'FETCH_HEAD'], { cwd: workspacePath });
|
||||
cp.spawnSync('git', ['clean', '-xdf'], { cwd: workspacePath });
|
||||
cp.spawnSync('git', ['fetch'], { cwd: workspacePath, stdio: 'inherit' });
|
||||
cp.spawnSync('git', ['reset', '--hard', 'FETCH_HEAD'], { cwd: workspacePath, stdio: 'inherit' });
|
||||
cp.spawnSync('git', ['clean', '-xdf'], { cwd: workspacePath, stdio: 'inherit' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue