Skip to content

Commit

Permalink
Update packages/angular/src/generators/ng-add/utilities/normalize-opt…
Browse files Browse the repository at this point in the history
…ions.ts

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
  • Loading branch information
Pascalmh and leosvelperez committed May 18, 2022
1 parent a288686 commit cc967f5
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@ export function normalizeOptions(
// use the name (scope if exists) in the root package.json
const { name } = readJson(tree, 'package.json');

if (!name) {
throw new Error(
'Add the name-property to your package.json and try again.'
);
if (name) {
npmScope = name.startsWith('@') ? name.split('/')[0].substring(1) : name;
}

npmScope = name.startsWith('@') ? name.split('/')[0].substring(1) : name;
}

return { ...options, npmScope };
Expand Down

0 comments on commit cc967f5

Please sign in to comment.