-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider removing template dirs in ~/.vue-templates/ when downloading updated templates #409
Comments
Hi, Can I submit a PR for this issue? I'm thinking of the following solutions:
I''m leaning towards option 1: simple and reliable. Or perhaps there is a more elegant way to handle this? (This fix is applicable only if --clone option is not set.) |
I like 1 as well. Another option to consider, is getting commit hashes from the template src and the directory and clean if they're different. |
Checking the hash would be a nice option. Here's what I found: 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. |
Yeah, it should be removed before downloading new template, I guess https://github.com/flipxfx/download-git-repo/pull/12 would fix the issue. |
I also like option 1, since there is already an --offline flag available to use the template cache. I believe that would also help resolve some of the issues found in #403 |
I've created a pull request for this #450. I'm not sure the onus should be on flipxfx/download-git-repo#12 to fix this issue, even though it would make sense for it to also remove existing directories, or at least throw a relevant error. |
I've recently had this PR "bite me in the butt". Basically I'm travelling a lot at the moment and offline most of the time. So I quickly set up some dummy ones so that the offline cache was populated with the templates I needed. Problem was, when I was offline a couple of days later I did a vue init without specifying --offline and this change deleted the template without me knowing. Meaning I couldn't then use it at all. Luckily I was able to re-purpose the dummy ones I'd created to cache the template in the first place. Perhaps there can be a safeguard whereby the cli detects the user is offline if they don't specify Also, could we add a cmd for downloading all the latest templates in one go? Something like |
Hello, 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 renamingclient-entry.js
andserver-entry.js
toentry-client.js
andentry-server.js
respectively.Upon testing out the newly pushed code, I discovered that
vue-cli
was still scaffoldingclient-entry.js
andserver-entry.js
as well asentry-client.js
andentry-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!
The text was updated successfully, but these errors were encountered: