Skip to content

Commit

Permalink
feat(core): throw graceful error in runNxMigration() if no collection (
Browse files Browse the repository at this point in the history
  • Loading branch information
trakhimenok committed Jun 10, 2022
1 parent 1937deb commit 1e90413
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/nx/src/command-line/migrate.ts
Expand Up @@ -1040,6 +1040,12 @@ async function runNxMigration(root: string, packageName: string, name: string) {

const collection = readJsonFile<MigrationsJson>(collectionPath);
const g = collection.generators || collection.schematics;
if (!g[name]) {
const source = collection.generators ? 'generators' : 'schematics';
throw new Error(
`Unable to determine implementation path for "${collectionPath}:${name}" using collection.${source}`
);
}
const implRelativePath = g[name].implementation || g[name].factory;

let implPath: string;
Expand Down

1 comment on commit 1e90413

@vercel
Copy link

@vercel vercel bot commented on 1e90413 Jun 10, 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-git-master-nrwl.vercel.app
nx-five.vercel.app
nx.dev
nx-dev-nrwl.vercel.app

Please sign in to comment.