forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.ts
More file actions
23 lines (18 loc) · 661 Bytes
/
util.ts
File metadata and controls
23 lines (18 loc) · 661 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import * as fs from 'fs';
import * as path from 'path';
export const ExtensionRootDir = path.dirname(__dirname);
export function getListOfFiles(filename: string): string[] {
filename = path.normalize(filename);
if (!path.isAbsolute(filename)) {
filename = path.join(__dirname, filename);
}
const data = fs.readFileSync(filename).toString();
const files = JSON.parse(data) as string[];
return files
.map(file => {
return path.join(ExtensionRootDir, file.replace(/\//g, path.sep));
});
}