Skip to content

Commit

Permalink
fix(angular): return error when name is missing from package.json (#1…
Browse files Browse the repository at this point in the history
…0356)

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
  • Loading branch information
Pascalmh and leosvelperez committed May 18, 2022
1 parent a89c360 commit 0de895d
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -35,7 +35,10 @@ export function normalizeOptions(
if (!npmScope) {
// use the name (scope if exists) in the root package.json
const { name } = readJson(tree, 'package.json');
npmScope = name.startsWith('@') ? name.split('/')[0].substring(1) : name;

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

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

0 comments on commit 0de895d

Please sign in to comment.