anishathalye / dotbot

A tool that bootstraps your dotfiles ⚡️
MIT License
7.04k stars 291 forks source link

Add Option to Ignore "Globbing couldn't find anything matching" #284

Closed patbakdev closed 1 year ago

patbakdev commented 3 years ago

I have the following config with the intention of being able to just drop in files/folders and have them automatically picked up. But if some folders are empty, then I get the warning ("Globbing couldn't find anything matching ...") and exit code 1. I'd like to have an option to ignore this warning and return exit code 0.

- defaults:
    link:
      create: true
      relink: true
      glob: true

- clean:
    - ~/
    - ~/.config
    - ~/.local
    - ~/.local/bin

- link:
    ~/:
      path: ./.*
      exclude:
        - ./.config
        - ./.local
    ~/.config/:
      path: ./.config/*
    ~/.local/:
      path: ./.local/*
      exclude:
        - ./.local/bin
    ~/.local/bin:
      path: ./.local/bin/*

Perhaps something like:

- link:
    ~/:
      path: ./.*
      ignore_empty_glob: true     <-- NEW
      exclude:
        - ./.config
        - ./.local
brutus commented 1 year ago

Same here. I'll add a quick PR (not thought through, missing test, etc. but works for me - so far YMMV).

anishathalye commented 1 year ago

This is now unconditionally allowed (no ignore_empty_glob: true required), as of 4daa065.