From 7adf9ca449b2efad4b038b5a11d22e6d11b5ee4c Mon Sep 17 00:00:00 2001 From: alok Date: Tue, 3 Sep 2019 09:53:45 +0530 Subject: [PATCH] resloved empty directory name issue --- package.json | 2 +- scripts/create.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 ") );