SamKirkland / plop-templates

VSCode extension for plop.js file templates
MIT License
23 stars 5 forks source link

Passing destinationpath input does not work #12

Closed tim-hoffmann closed 2 years ago

tim-hoffmann commented 3 years ago

Hi!

It looks like the extension does not execute the plop command correctly so that the destinationpath input is not bypassed. This is what the extension executes:

image

As from the plop docs and what I tried in the console there is a -- missing:

$ plop "component" -- --destinationPath "/Users/timhoffmann/dev/github/tim-hoffmann/saas-starter-frontend/src/components"

As I can see there has been a change in v1.1.0 which removed the extra --. Looks like that was by accident? 🤔

Thanks in advance Tim

sebastien-lb commented 3 years ago

Could the fix be as simple as this https://github.com/sebastien-lb/plop-templates/pull/1/files ? @tim-hoffmann I found the same thing as you on the plop documentation. I will try to build and test the extension with the modification on my fork before submitting a PR here. @SamKirkland would you be ok to merge if it fix the issue? :)

tim-hoffmann commented 3 years ago

Hi @sebastien-lb, yes your change looks good to me! It should solve the issue.

sebastien-lb commented 3 years ago

I tested locally and the destination path is correctly passed to the plop command and not asked anymore by the prompt. PR is here: https://github.com/SamKirkland/plop-templates/pull/13

philiiiiiipp commented 3 years ago

Until this the MR is merged, you can somewhat get around it by changing the command to --destinationPath ( in my case I use location )

Screenshot 2021-07-09 at 12 52 39