|
1 | 1 | // Copyright (c) Microsoft Corporation. All rights reserved.
|
2 | 2 | // Licensed under the MIT License.
|
3 | 3 | 'use strict';
|
4 |
| -import * as glob from 'glob'; |
5 | 4 | import { inject, injectable } from 'inversify';
|
6 | 5 | import * as path from 'path';
|
7 | 6 |
|
@@ -107,14 +106,10 @@ export class ThemeFinder implements IThemeFinder {
|
107 | 106 |
|
108 | 107 | // Search through all package.json files in the directory and below, looking
|
109 | 108 | // for the themeName in them.
|
110 |
| - const foundPackages = await new Promise<string[]>((resolve, reject) => { |
111 |
| - glob('**/package.json', { cwd: rootPath }, (err, matches) => { |
112 |
| - if (err) { |
113 |
| - reject(err); |
114 |
| - } |
115 |
| - resolve(matches); |
116 |
| - }); |
117 |
| - }); |
| 109 | + const fs = new FileSystem( |
| 110 | + new PlatformService() |
| 111 | + ); |
| 112 | + const foundPackages = await fs.search('**/package.json', rootPath); |
118 | 113 | if (foundPackages.length > 0) {
|
119 | 114 | // For each one, open it up and look for the theme name.
|
120 | 115 | for (const f of foundPackages) {
|
@@ -167,14 +162,10 @@ export class ThemeFinder implements IThemeFinder {
|
167 | 162 | private async findMatchingThemes(rootPath: string, themeName: string) : Promise<IThemeData | undefined> {
|
168 | 163 | // Search through all package.json files in the directory and below, looking
|
169 | 164 | // for the themeName in them.
|
170 |
| - const foundPackages = await new Promise<string []>((resolve, reject) => { |
171 |
| - glob('**/package.json', { cwd: rootPath }, (err, matches) => { |
172 |
| - if (err) { |
173 |
| - reject(err); |
174 |
| - } |
175 |
| - resolve(matches); |
176 |
| - }); |
177 |
| - }); |
| 165 | + const fs = new FileSystem( |
| 166 | + new PlatformService() |
| 167 | + ); |
| 168 | + const foundPackages = await fs.search('**/package.json', rootPath); |
178 | 169 | if (foundPackages.length > 0) {
|
179 | 170 | // For each one, open it up and look for the theme name.
|
180 | 171 | for (const f of foundPackages) {
|
|
0 commit comments