Skip to content

A Dotbot plugin that helps ensure (or exclude) specific lines in a file.

License

Notifications You must be signed in to change notification settings

wonderbeyond/dotbot-ed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotbot ED Plugin

A Dotbot plugin that helps ensure expected lines in a file.

Installation

  1. Simply add this repo as a submodule of your dotfiles repository:
git submodule add https://github.com/wonderbeyond/dotbot-ed.git
  1. Pass the path of ed.py to Dotbot script:
  • -p dotbot-ed/ed.py

Usage

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'

Directives

  • 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...

About

A Dotbot plugin that helps ensure (or exclude) specific lines in a file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages