diff --git a/package.json b/package.json index 4579a74..6605028 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-react-webpack", - "version": "0.1.0", + "version": "0.1.1", "description": "create-react-webpack ", "main": "scripts/create.js", "bin": { diff --git a/scripts/create.js b/scripts/create.js index 3c39493..780d69d 100755 --- a/scripts/create.js +++ b/scripts/create.js @@ -12,7 +12,9 @@ var args = process.argv.slice(2); var dirName = args[0]; var end_to_end = args[1]; -if (dirName[0].match("^[A-Z0-9]")) { +if (dirName === "undefined") { + throw new Error(ErrorMessage("directory name can't be empty")); +} else if (dirName[0].match("^[A-Z0-9]")) { throw new Error( ErrorMessage("directory name can't start from capital letters ") );