how to create multiple template file always strarting from the root ?

I'm trying to create a template file that would create 3 files and always put them in the good folder no matter where I click to create a my new template. so if I do new>mytemplate and create a 'test' file I end up like this:

Myproject/
├── routes/
│   └── test.controller.js
├── models/
│   └── test.model.js
├── controllers/
│   └── test.route.js
└── server.js

I tried to create a new template called component and added two sub-files.

  • In my parent file I put this path controllers/${NAME}.controller/
  • In the first sub-files I put that path models/${NAME}.model
  • And in the third one I put routes/${NAME}.route

So when I click on the root folder and make new>component and type test in the input area, it create the files according to the tree schema I defined before. But if I do this anywhere else it screw up things and create new subfolder and my files in them.

Is there a way so that no matter where I click to create a new component it always start from the root path ?

2 comments
Comment actions Permalink

It seems it is possible right now with /my/path syntax (starting file name with a slash)

1
Comment actions Permalink

it's not working if I clic on `model` folder it just create the directories inside it

0

Please sign in to leave a comment.