Skip to content

Commit

Permalink
fix(docz-core): check name on package json
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Jul 3, 2018
1 parent 8be3724 commit 6cdbebc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/docz-core/src/commands/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as paths from '../config/paths'
const removeScope = (name: string) => name.replace(/^@.*\//, '')
const getInitialTitle = () => {
const pkg = fs.readJsonSync(paths.packageJson, { throws: false })
const name = pkg ? pkg.name : 'MyDoc'
const name = pkg && pkg.name ? pkg.name : 'MyDoc'

return titleize(humanize(removeScope(name)))
}
Expand Down

0 comments on commit 6cdbebc

Please sign in to comment.