diff --git a/package-lock.json b/package-lock.json index fd9d24b..d8ce6cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "commander-cli", - "version": "1.0.0", + "name": "typescript-generator", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b468674..a66d207 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,14 @@ { - "name": "commander-cli", - "version": "1.0.0", - "description": "a simple cli tool", - "main": "index.js", + "name": "typescript-generator", + "version": "1.1.0", + "description": "a simple cli tool to help you generate typescript setup", + "main": "tssg.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "start": "node tssg.js" + }, + "preferGlobal": true, + "bin": { + "tssg": "tssg.js" }, "author": "Valentine Oragbakosi", "license": "ISC", diff --git a/tssg.js b/tssg.js index ea9a5a5..372ba63 100755 --- a/tssg.js +++ b/tssg.js @@ -17,12 +17,13 @@ program if(program.create) { - fse.copy('./setup', `./${`-%s create`, program.create}`, err=>{ - console.log(`Typescript setup created`); - console.log(`cd ${`-%s create`, program.create}`); - console.log(`npm install`) - }) - + try{ + fse.copySync('./setup', `./${`-%s create`, program.create}`) + console.log(`cd ${`-%s create`, program.create}`); + console.log(`npm install`) + }catch(err){ + console.log(err) + } rl.close(); }