Skip to content

Commit 92d4707

Browse files
authored
feat: support . as project name to use current directory (#77)
1 parent 0aad144 commit 92d4707

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,12 @@ const updatePackageJson = (
487487
}
488488
}
489489

490-
if (name && name !== '.') {
490+
if (name === '.') {
491+
const projectName = path.basename(path.dirname(pkgJsonPath));
492+
if (projectName.length) {
493+
pkg.name = projectName;
494+
}
495+
} else if (name) {
491496
pkg.name = name;
492497
}
493498

0 commit comments

Comments
 (0)