Skip to content

Commit 584fd8e

Browse files
nyqykknyqykk
and
nyqykk
authored
feat: support specify package name (#38)
Co-authored-by: nyqykk <[email protected]>
1 parent d620bbb commit 584fd8e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export type Argv = {
8080
template?: string;
8181
override?: boolean;
8282
tools?: string | string[];
83+
'package-name'?: string;
8384
};
8485

8586
function logHelpMessage(name: string, templates: string[]) {
@@ -93,6 +94,7 @@ function logHelpMessage(name: string, templates: string[]) {
9394
-t, --template specify the template to use
9495
--tools select additional tools (biome, eslint, prettier)
9596
--override override files in target directory
97+
--package-name specify the package name
9698
9799
Templates:
98100
@@ -200,7 +202,9 @@ export async function create({
200202
}),
201203
);
202204

203-
const { targetDir, packageName } = formatProjectName(projectName);
205+
const formatted = formatProjectName(projectName);
206+
const { targetDir } = formatted;
207+
const packageName = argv['package-name'] || formatted.packageName;
204208
const distFolder = path.isAbsolute(targetDir)
205209
? targetDir
206210
: path.join(cwd, targetDir);

0 commit comments

Comments
 (0)