TheLocehiliosan / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
4.91k stars 176 forks source link

Add a header to generated files from templates #447

Closed Namorzyny closed 1 year ago

Namorzyny commented 1 year ago

Is your feature request related to a problem? Please describe.

When I edit my config files, I often mistakenly make changes on generated files. If I miss that, I will lose all my changes maybe…

Describe the solution you'd like

Maybe we should add a header to the generated file. A notice about this file is generated automatically. But, there are too many file types with tons of different comment syntax… That’s a big problem… Any idea?

erijo commented 1 year ago

I have added this to some of my templates.

# DO NOT EDIT. Generated from: {{ yadm.source }}

That gets you the header in the generated file, even if it's not added automatically.

Namorzyny commented 1 year ago

I have added this to some of my templates.

# DO NOT EDIT. Generated from: {{ yadm.source }}

That gets you the header in the generated file, even if it's not added automatically.

That's a good idea! I decided generating the header like this:

# {% include "do_not_edit.txt" %}

/*
{% include "do_not_edit.txt" %}
*/