Skip to content

Commit 9fcb9c9

Browse files
committed
fix: migration handling
1 parent 4898d7c commit 9fcb9c9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

packages/plugin-tools/src/migrations/update-4-1-0/update-4-1-0.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,19 @@ export default async function (tree: Tree) {
5454
const collectionPath = readPackageMigrationConfig(packageName).migrations;
5555
let implPath: string;
5656

57-
try {
58-
implPath = require.resolve(implRelativePath, {
59-
paths: [dirname(collectionPath)],
60-
});
61-
} catch (e) {
62-
// workaround for a bug in node 12
63-
implPath = require.resolve(`${dirname(collectionPath)}/${implRelativePath}`);
57+
if (collectionPath) {
58+
try {
59+
implPath = require.resolve(implRelativePath, {
60+
paths: [dirname(collectionPath)],
61+
});
62+
} catch (e) {
63+
// workaround for a bug in node 12
64+
implPath = require.resolve(`${dirname(collectionPath)}/${implRelativePath}`);
65+
}
66+
67+
const fn = require(implPath).default;
68+
await fn(tree, {});
6469
}
65-
66-
const fn = require(implPath).default;
67-
await fn(tree, {});
6870
}
6971
// TODO: Edit the generators to use the new tsconfig
7072

0 commit comments

Comments
 (0)