Closed codeBelt closed 4 years ago
I'm glad I could help :) I just fount out the yargs library. What a great tool !
Just a detail: you don't check that all string replacers are passed as arguments. I think it would be better if we can inform the user that something is missing.
Is it possible to run node ./tools/generate.js create-reduce-action
and then follow prompts for file name, etc? So far, passing option name in the command line doesn't work for me at all (I'm still being prompted with "What do you want to generate?" question.
I want to call something like npm run gen spec
similar to ng generate class
command and then provide input for the file name. Thanks!
Now you can use the command line to generate template files. https://github.com/codeBelt/generate-template-files/issues/31
Here's the break down
node ./tools/generate.js
- Runs the generate-template-files library.angular-ngrx-store
is the template name; It uses the sameoption
name in theIConfigItem
but converts alloptions
names to kebab-case. For exampleoption: 'Angular Ngrx Store'
will be converted toangular-ngrx-store
when using the command line.__name__=some-name
and__model__=some-other-name
are Replacer Slots and will be converted to{ slot: "__name__", slotValue: "some-name" }
--outputpath=./src/here
- Will override theoutput.path
in theIConfigItem
--overwrite
Will overwrite files if the files already existsTry it out and let me know if you have any feedback. I will publish this probably tomorrow after I get the README updated.
Thanks @knona for your on helping me with this.
@dennbagas @CGeorges