anishathalye / dotbot

A tool that bootstraps your dotfiles ⚡️
MIT License
6.91k stars 288 forks source link

The configuration in a single-line profile will not run unless there is an empty line at the end of the file #297

Open Vafa-Andalibi opened 2 years ago

Vafa-Andalibi commented 2 years ago

Just noticed this behavior when my test profile had just one configuration and dotbot was skipping it and wasn't performing any operation. After adding a new line at the end of the profile, it started working again.

anishathalye commented 2 years ago

If there's nothing sensitive in the file, could you share the problematic config file itself? That would help me reproduce/debug the issue.

Vafa-Andalibi commented 2 years ago

Sure this is the base-clean.yaml in config folder:

- defaults:
    link:
      create: true
      force: true

- clean: ['~']

- clean:
    ~/:
      force: true
    ~/.config:
      recursive: true

- create:
    - ~/Downloads
    - ~/.vim/undo-history
- create:
    ~/.ssh:
      mode: 0700
    ~/gitrepos:

This is generic_device in the profile folder (note that there is no empty line at the end):

base-clean

then run:

./install-profile base-clean

which will NOT run the base-clean profile.

If you add an empty line to generic_device it will work:

base-clean
anishathalye commented 2 years ago

Oh yes, this is because of the way https://github.com/anishathalye/dotbot/wiki/Tips-and-Tricks#install-profile is implemented, it requires newline-separated names with a newline after every name.