Use folder name when metadata name is empty string or non-string

This commit is contained in:
Kevin Sawicki
2015-06-10 16:46:35 -07:00
parent 4d76e607f0
commit 0edce07446
3 changed files with 4 additions and 3 deletions

View File

@@ -45,7 +45,8 @@ class Package
throw error unless ignoreErrors
metadata ?= {}
metadata.name ?= packageName
unless typeof metadata.name is 'string' and metadata.name.length > 0
metadata.name = packageName
if includeDeprecatedAPIs and metadata.stylesheetMain?
deprecate("Use the `mainStyleSheet` key instead of `stylesheetMain` in the `package.json` of `#{packageName}`", {packageName})