Support offline template generation with the toolbox
BennyDeBock opened this issue · 1 comments
Recently I was stuck at a place with no internet trying to start up a new Vapor project and I got a failed to clone template message from the toolbox. This frustrated me but it got me thinking.
.NET especially and other tools/languages sometimes have offline template generators. I know that is hard to do with Vapor since the template is prone to changing and in a separate repository. But having the option to generate a template while you're working offline would be a great addition to the toolbox.
One way I could see this being achieved with the toolbox is that whenever it clones the template repository, it could store that repository somewhere. And every time you generate a new project, if you'd have no internet connection it'd use that template that's stored to generate your starting template.
The issue with this is that the stored template might get outdated, but a solution to this could be to check (when you do have an internet connection) if the stored template is behind on the main branch, you pull in the new template and replace the old one stored locally.
- copy the template in the home directory
- use that template
- on every
vapor new
command, check if that template is outdated or not - replace the template if it's outdated