Skip to content

Commit

Permalink
fix: migration handling
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed Sep 17, 2022
1 parent 4898d7c commit 9fcb9c9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/plugin-tools/src/migrations/update-4-1-0/update-4-1-0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,19 @@ export default async function (tree: Tree) {
const collectionPath = readPackageMigrationConfig(packageName).migrations;
let implPath: string;

try {
implPath = require.resolve(implRelativePath, {
paths: [dirname(collectionPath)],
});
} catch (e) {
// workaround for a bug in node 12
implPath = require.resolve(`${dirname(collectionPath)}/${implRelativePath}`);
if (collectionPath) {
try {
implPath = require.resolve(implRelativePath, {
paths: [dirname(collectionPath)],
});
} catch (e) {
// workaround for a bug in node 12
implPath = require.resolve(`${dirname(collectionPath)}/${implRelativePath}`);
}

const fn = require(implPath).default;
await fn(tree, {});
}

const fn = require(implPath).default;
await fn(tree, {});
}
// TODO: Edit the generators to use the new tsconfig

Expand Down

0 comments on commit 9fcb9c9

Please sign in to comment.