Skip to content

Commit 221f4f6

Browse files
authored
Merge pull request #59 from CVarisco/58-path-param
Add args parameters merge with configs
2 parents 1804dd4 + abdf9f4 commit 221f4f6

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ $ create-component-app --config path/to/your/config.json
115115

116116
**Passing a config file via the CLI overrides the configuration file loaded by [cosmiconfig](https://github.com/davidtheclark/cosmiconfig)**
117117

118+
### You can pass params from the command line
119+
120+
```sh
121+
$ create-component-app --path path/destionation
122+
```
123+
124+
**Passing a param via the CLI overrides the configuration file loaded by [cosmiconfig](https://github.com/davidtheclark/cosmiconfig)**
125+
118126
### You can use your own custom templates
119127

120128
Simple steps to create your own templates [docs/custom-templates](https://github.com/CVarisco/create-component-app/blob/master/docs/CUSTOM-TEMPLATES.md)

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-component-app",
3-
"version": "1.4.2",
3+
"version": "1.5.0",
44
"description": "Tool to generate different types of React components from the terminal.",
55
"bin": {
66
"create-component-app": "./dist/index.js"

src/files.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ function generateFileName(newFilePath, newFileName, templateFileName) {
5151
if (templateFileName.includes('COMPONENT_NAME')) {
5252
return templateFileName.replace(/COMPONENT_NAME/g, newFileName)
5353
}
54-
console.log(templateFileName)
5554
return templateFileName
5655
}
5756

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ import {
1919
import { questions } from './questions'
2020

2121
const args = yargs.argv
22-
const config = getConfig(args.config)
22+
const config = {
23+
...getConfig(args.config),
24+
...args,
25+
}
2326

2427
async function getTemplatesPath(templateName = null) {
2528
const { templatesDirPath } = config

0 commit comments

Comments
 (0)