SuperCuber / dotter

A dotfile manager and templater written in rust 🦀
The Unlicense
875 stars 46 forks source link

[FEATURE] dotter init should be recursive #125

Open KrullBorg opened 1 year ago

KrullBorg commented 1 year ago

Is your feature request related to a problem? Please describe. For directories dotter init makes empty items in default package files section

Describe the solution you'd like I think it should be recursive, considering each directory as a package (as GNU Stow)

For example, this .dotfiles directory

bash/.bashrc
bash/.bash_logout
bash/.profile
emacs/.emacs
openbox/.config/openbox/rc.xml

should produce this global.toml

[default]
depends = []

[default.files]

[default.variables]

[bash]
depends = []

[bash.files]
"bash/.bashrc"="~/.bashrc"
"bash/.bash_logout"="~/.bash_logout"
"bash/.profile"="~/.profile"

[emacs]
depends = []

[emacs.files]
"emacs/.emacs"="~/.emacs"

[emacs.variables]

[openbox]
depends = []

[openbox.files]
"openbox/.config/openbox/rc.xml"="~/.config/openbox/rc.xml"

[openbox.variables]
SuperCuber commented 1 year ago

Right now dotter init is there for you to avoid getting stuck on basic toml syntax or field names. It's all empty on purpose.

I think this could be a cool idea to add as a dotter init --stow flag though. I'm not sure how stow does things exactly, but I assume this would only take folders and ignore files at the top level. A PR for this is very welcome :)

KrullBorg commented 1 year ago

ok i'll try