Huuums/vscode-folder-templates

My templates disappeared from the global .fttemplates folder

Closed this issue · 8 comments

Hi,

All has been well until I ran CleanMyMac this morning. I just discovered that all my templates in the global . fttemplates directory have disappeared or were deleted by CleanMyMac.

Is it possible to have this fttemplates directory in another folder that probably contains all my projects (since the template is reused by all projects), instead of duplicating the template in each project folder?

Hi,

All has been well until I ran CleanMyMac this morning. I just discovered that all my templates in the global . fttemplates directory have disappeared or were deleted by CleanMyMac.

Is it possible to have this fttemplates directory in another folder that probably contains all my projects (since the template is reused by all projects), instead of duplicating the template in each project folder?

Apologies, CleanMyMac is not the culprit. I created some folders again then ran CleanMyMac, and the folders are still there. Any idea why the initial ones disappeared?

This is the second time i've heard about this in a short timespan. I don't know yet what is causing this and thought this might have been a user error but maybe it isnt.

@green-anger sorry to ping you but did you have global templates as well? Or were your deleted templates local ones in a project

Hey @Huuums, no problem.

I work on Win10 and yes I'm using the global folder, current path is ~.vscode\extensions\huuums.vscode-fast-folder-structure-3.6.1.fttemplates

The plugin folder name includes the current version (-3.6.1 in this case), I'm 100% sure it was different with the previous version (don't remember which exactly, maybe -3.6.0). So, my guess is VS Code removed the previous plugin version folder and created a new one and it's empty by default. I have no idea if it can be managed in the settings or has something to do with the plugin itself.

Hope that helps.

Thank you very much. I hope you have backed up the templates this time because a 3.7.0 update rolled out. Man that's a bummer.

I will investigate a little further and hopefully can figure out how to prevent this. But just to be on the safe side I will also give the option to configure your own global template folder path with the next version.

I'm really sorry this happened to you two and anyone else that might come in here.

I think I kind of understand what's happening but I'm also not 100% sure because I can't test this properly without potentially breaking more things for more users.

I think that because I didn't use the .vscodeignore file correctly and had an .fttemplates folder in my extension project this might have overridden existing folders because my empty folder was also published. That would mean that this problem arose out of pure ignorance on my side because I didn't know how the publishing process works in detail.

I thought the publishing process bundled everything into a single js file which is then the extension that gets installed. Turns out that's not how it is and it takes everything that I don't ignore in that file and publishes it as part of the extension.

Once again I can only say I'm sorry.

That being said. Now that I did put that into the ignore file I'm still not 100% sure that it won't happen again. It might still have to do with the versioning number of the extension folder jumping around and deleting things due to that.

So with the next version which will drop shortly you will be able to set a custom global template folder path which I highly encourage to use.

Please also backup your global templates to another folder for now.

Thank you so much @Huuums for your time. I'll look forward to the update. Your plugin is really a life saver.

In the meantime, I have set the global folder to automatically sync to my Google Drive.

Cheers & Happy Holidays.

No problem. Thanks for taking the time to reach out.

Happy holidays to you too.

Update should be out. You can set your new custom global directory with the command "Set custom global folder templates directory" or just put the path into the settings directly

@Huuums FYI, I didn't notice your message about the new update, ran VS Code and the plugin was updated automatically, the previous version didn't have any global templates, so it's not clear if it'd have been copied or moved. However, now I have two different folders:
huuums.vscode-fast-folder-structure-3.7.0
huuums.vscode-fast-folder-structure-3.8.0

So, maybe it wouldn't have been removed this time. I added some content to the default global template folder and will see how it'll work next time.

Cheers!