feat: cli args

This commit is contained in:
2025-05-29 12:52:13 +09:00
parent 23b81017ec
commit 4c1d9d9afe
2 changed files with 2 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "create-computercraft", "name": "create-computercraft",
"version": "1.0.0", "version": "1.0.1",
"description": "", "description": "",
"bin": { "bin": {
"create-computercraft": "dist/main.js" "create-computercraft": "dist/main.js"

View File

@@ -15,6 +15,7 @@ async function main() {
const projectName = await text({ const projectName = await text({
message: "What is your project name?", message: "What is your project name?",
initialValue: process.argv?.[2] ?? undefined,
validate(value) { validate(value) {
if (!validate(value)) if (!validate(value))
return "Project name should satisfy NPM package name rules."; return "Project name should satisfy NPM package name rules.";