mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
Improve output in case of errors and generate an analysis folder with the source content (for easy diffing)
This commit is contained in:
@@ -243,6 +243,31 @@ export function rimraf(dir: string): () => Promise<void> {
|
||||
return result;
|
||||
}
|
||||
|
||||
function _rreaddir(dirPath: string, prepend: string, result: string[]): void {
|
||||
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
||||
for (const entry of entries) {
|
||||
if (entry.isDirectory()) {
|
||||
_rreaddir(path.join(dirPath, entry.name), `${prepend}/${entry.name}`, result);
|
||||
} else {
|
||||
result.push(`${prepend}/${entry.name}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function rreddir(dirPath: string): string[] {
|
||||
let result: string[] = [];
|
||||
_rreaddir(dirPath, '', result);
|
||||
return result;
|
||||
}
|
||||
|
||||
export function ensureDir(dirPath: string): void {
|
||||
if (fs.existsSync(dirPath)) {
|
||||
return;
|
||||
}
|
||||
ensureDir(path.dirname(dirPath));
|
||||
fs.mkdirSync(dirPath);
|
||||
}
|
||||
|
||||
export function getVersion(root: string): string | undefined {
|
||||
let version = process.env['BUILD_SOURCEVERSION'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user