Consider removing template dirs in ~/.vue-templates/ when downloading updated templates
See original GitHub issueHello, I maintain a vue-cli
template and I recently made some updates to make use of Vue’s new SSR features. Part of stealing Evan You’s code from the hackernews example involved renaming client-entry.js
and server-entry.js
to entry-client.js
and entry-server.js
respectively.
Upon testing out the newly pushed code, I discovered that vue-cli
was still scaffolding client-entry.js
and server-entry.js
as well as entry-client.js
and entry-server.js
.
This problem was resolved by deleting the .vue-templates
folder in my home dir.
I suspect this will become a bigger issue when any official/popular template renames (or possibly deletes) a file. And it will affect any user that used the template prior to the file changes.
Because of this, I think that at a minimum, a note about the .vue-templates
dir should be added to the README - Though I believe this is a subpar solution as the user may not even be aware that there are problems/dead code.
I think, ideally, vue-cli
should remove template dirs when downloading updated templates.
Thank vue very much for your time!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:7
Top GitHub Comments
Yeah, it should be removed before downloading new template, I guess https://github.com/flipxfx/download-git-repo/pull/12 would fix the issue.
@Narkoleptika
Checking the hash would be a nice option. Here’s what I found: While github offers http API to get remote hash (example) there is no option in the local repo. This is because ‘download-git-repo’ use http/s protocol to download and extract the ‘master.zip’ (see here and here) And the solution will also have to work across all providers: github, gitlab, bitbucket etc…
Unless there is a better way, it’s best to limit the scope of this PR to fixing the issue with option 1 and optimize it later.