Skip to content

Commit

Permalink
fix: incorrect name handling from existing package.json
Browse files Browse the repository at this point in the history
fix missing name from existing package.json with missing name property

re #198
  • Loading branch information
osdevisnot committed Mar 12, 2021
1 parent 04ab682 commit d8bb9da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const writePackage = async (ext, { user, email }) => {

if (exists('./package.json')) {
pkg = JSON.parse(await read('./package.json'))
name = pkg.name.split('/').pop()
if (pkg.name) name = pkg.name.split('/').pop()
}

const source = `src/${name}.${ext}`
Expand Down

0 comments on commit d8bb9da

Please sign in to comment.