Skip to content

Commit

Permalink
fix(core): fix migrating old workspaces without nx
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Apr 26, 2022
1 parent 7d4255e commit 1163f4c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/nx/src/command-line/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export function parseMigrationsOptions(options: {
function versions(root: string, from: Record<string, string>) {
const cache: Record<string, string> = {};

return (packageName: string) => {
function getFromVersion(packageName: string) {
try {
if (from[packageName]) {
return from[packageName];
Expand All @@ -475,9 +475,15 @@ function versions(root: string, from: Record<string, string>) {

return cache[packageName];
} catch {
// Support migrating old workspaces without nx package
if (packageName === 'nx') {
return getFromVersion('@nrwl/workspace');
}
return null;
}
};
}

return getFromVersion;
}

// testing-fetch-start
Expand Down

0 comments on commit 1163f4c

Please sign in to comment.