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