SuperCuber / dotter

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

[FEATURE] Init command #15

Closed vchirikov closed 4 years ago

vchirikov commented 4 years ago

Hi, it will be useful to have the init command to create a dotter_settings folder with configs.

SuperCuber commented 4 years ago

What would you expect the contents of the files to look like? The only two options I see are:

What are your thoughts?

vchirikov commented 4 years ago

I tried the tool today and got

[ERROR] Failed to deploy
        Caused by:
            Failed to get a configuration
            Failed to parse config file dotter_settings/local.toml
            Failed to parse file dotter_settings/local.toml
            Failed to missing field `packages`

because I didn't have any "packages" in my empty local.toml. Your example (I mean your dotfiles repo) doesn't have this file too. So it took some time to figure out what to add and where I can find an example of this. So yes, I think is't good idea to give new users something to bootstrap a default "package".

SuperCuber commented 4 years ago

I see. Now that I think about it, it could be a good idea to make it easier to "just get it working". Where do you think I should mention this option in the documentation (readme and wiki)? Which place would you be the most likely to spot it if you were a new user? (of course it will also be described in --help)

By the way, for more information about the configuration files, check out this wiki page.

vchirikov commented 4 years ago

It would be nice to get "help" if the tool didn't find any configs (like git for example). Today dotter throws the error:

> dotter
[ERROR] Failed to deploy
        Caused by:
            Failed to get a configuration
            Failed to find config files

And maybe the tool should deploy all configurations if local.toml not found or the config line with packages is missing

SuperCuber commented 4 years ago

And maybe the tool should deploy all configurations if local.toml not found or the config line with packages is missing

I think that'd be unexpected behavior. I understand wanting it to "just work" in the trivial case without a local.toml, but a mature local.toml has more than just packages - it can have additional variables and file overrides. Just deploying all packages in case such a local.toml isn't found potentially result in files thrown in wrong locations with wrong content - nothing an --undeploy can't fix, but still a bad user experience in my opinion.

Plus, having dotter init would cover the "just make it work" use-case anyways.

SuperCuber commented 4 years ago

Closed in 9a5db71bcf9e1b6088c2d268f8731edd56289daf.

@vchirikov , I'd appreciate it if you checked it out :)

EDIT: It's in Release v0.8.0

SuperCuber commented 4 years ago

Reopening to remind myself that I also need to document this

SuperCuber commented 4 years ago

Mentioned it in "Setup" wiki page