Skip to content

Commit

Permalink
fix(core): fix migrating old workspaces without nx (#10011)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Apr 26, 2022
1 parent 3d56368 commit 83ba230
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/nx/src/command-line/migrate.ts
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

1 comment on commit 83ba230

@vercel
Copy link

@vercel vercel bot commented on 83ba230 Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx.dev
nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app

Please sign in to comment.