diff --git a/README.md b/README.md index c547f01..198d58d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Steps: - Put this in your "scripts" section of the package.json: ```json - "g": "node ./node_modules/xtuff/index.js g" + "g": "xtuff g" ``` - Create your custom stuff inside the new `_templates_` folder that you should be have. - Run (for example) `npm run g component helloComponent` diff --git a/generator.js b/generator.js index 2cf14a9..c3926e8 100644 --- a/generator.js +++ b/generator.js @@ -100,7 +100,7 @@ module.exports = (generatorName, stuffPath) => { if (fs.existsSync(generatorTemplateFolder)) { const stuffName = getStuffName(stuffPath); - if(stuffPath[0] !== '/') stuffPath = path.join(process.cwd(), stuffPath); + if(stuffPath[0] !== '/') stuffPath = path.join(process.env.INIT_CWD, stuffPath); createTempFolder().then(cacheFolderPath => { copyResourcesToTempFolder(stuffName, generatorTemplateFolder, cacheFolderPath).then(() => { diff --git a/package.json b/package.json index 83d80a4..eba319a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xtuff", - "version": "1.0.3", + "version": "1.0.5", "description": "A dev command to create stuffs easy! (components, services, etc...)", "keywords": "command, generator, component, service, react, stuff, files", "repository": "https://github.com/jaumesegarra/xtuff",