mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 10:58:31 -05:00
Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3 (#6516)
* Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3 * fix tests
This commit is contained in:
24
test/tree/tree.js
Normal file
24
test/tree/tree.js
Normal file
@@ -0,0 +1,24 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
function collect(location) {
|
||||
const element = { name: path.basename(location) };
|
||||
const stat = fs.statSync(location);
|
||||
|
||||
if (!stat.isDirectory()) {
|
||||
return { element, incompressible: true };
|
||||
}
|
||||
|
||||
const children = fs.readdirSync(location)
|
||||
.map(child => path.join(location, child))
|
||||
.map(collect);
|
||||
|
||||
return { element, children };
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(collect(process.cwd())));
|
||||
Reference in New Issue
Block a user