Skip to content

Commit

Permalink
Fixed ENOENT not returning
Browse files Browse the repository at this point in the history
  • Loading branch information
brycez1 committed Jan 24, 2024
1 parent 123d57c commit 5f8be1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/meta/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ Dependencies.checkModule = function (moduleName) {
return __awaiter(this, void 0, void 0, function* () {
try {
let pkgData = yield fs_1.default.promises.readFile(path_1.default.join(constants_1.paths.nodeModules, moduleName, 'package.json'), 'utf8');
pkgData = Dependencies.parseModuleData(moduleName, pkgData) || '';
pkgData = Dependencies.parseModuleData(moduleName, pkgData);
const satisfies = Dependencies.doesSatisfy(pkgData, package_json_1.default.dependencies[moduleName]);
return satisfies;
}
catch (err) {
// The next line calls a function in a module that has not been updated to TS yet
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (err.code === 'ENOENT' && constants_1.pluginNamePattern.test(moduleName)) {
winston_1.default.warn(`[meta/dependencies] Bundled plugin ${moduleName} not found, skipping dependency check.`);
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/meta/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ Dependencies.check = async function () {
Dependencies.checkModule = async function (moduleName) {
try {
let pkgData = await fs.promises.readFile(path.join(paths.nodeModules, moduleName, 'package.json'), 'utf8');
pkgData = Dependencies.parseModuleData(moduleName, pkgData) || '';
pkgData = Dependencies.parseModuleData(moduleName, pkgData);

const satisfies = Dependencies.doesSatisfy(pkgData, pkg.dependencies[moduleName] as string);
return satisfies;
} catch (err) {
// The next line calls a function in a module that has not been updated to TS yet
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (err.code === 'ENOENT' && pluginNamePattern.test(moduleName)) {
winston.warn(`[meta/dependencies] Bundled plugin ${moduleName} not found, skipping dependency check.`);
return true;
Expand Down

0 comments on commit 5f8be1d

Please sign in to comment.