fix(angular): return error when name is missing from package.json (#10356)
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
This commit is contained in:
parent
a89c360f46
commit
0de895d35e
@ -35,7 +35,10 @@ export function normalizeOptions(
|
|||||||
if (!npmScope) {
|
if (!npmScope) {
|
||||||
// use the name (scope if exists) in the root package.json
|
// use the name (scope if exists) in the root package.json
|
||||||
const { name } = readJson(tree, '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 };
|
return { ...options, npmScope };
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user