A Dotbot plugin that helps ensure expected lines in a file.
- Simply add this repo as a submodule of your dotfiles repository:
git submodule add https://github.com/wonderbeyond/dotbot-ed.git
- Pass the path of
ed.py
to Dotbot script:
-p dotbot-ed/ed.py
Example config:
- sudo:
- ensure_lines:
- file: /etc/hosts
lines:
- pattern: '^127\.0\.0\.1\s+localhost[\s$]'
content: '127.0.0.1 localhost'
- pattern: '^10\.10\.10\.88(\s+)wonder-dev-001[\s$]'
content: '10.10.10.88 wonder-dev-001'
ensure_lines
: Ensure a file has specified lines, given a (regex) pattern to check if the line exists and the content to append if check fails.drop_lines
: Coming...