GithubHelp home page GithubHelp logo

dotbot-includes's Introduction

Dotbot Include Plugin

This Dotbot plugin allows you to include and run other Dotbot configuration files from your main configuration yaml file. This can be useful for organizing and modularizing your Dotbot setup.

Installation

  1. Clone this repository as a submodule in your Dotbot configuration directory: git submodule add https://github.com/vanduc2514/dotbot-includes.git
  2. Update the submodule git submodule update --ini --recursive
  3. Pass the includes.py to the dotbot CLI argument: -p dotbot-icludes/includes.py

For example

dotbot -d dotfiles -c install.conf.yaml -p dotbot-includes/includes.py

Usage

In the main dotbot configuration file, use the includes directive. Specify the paths to other base directories and configuration files.

For example, given this file structure

dotfiles
|-- install.conf.yaml
|-- bash
|   |-- bash.yaml

Then the includes directive is specified as

# Other directives like link, shell
- includes:
    bash: bash.yaml

When executing command dotbot -d dotfiles -c install.conf.yaml -p dotbot-includes/includes.py dotbot will execute directives in bash.yaml under the base directory bash. The path to bash.yaml is relative to the base directory bash

The includes Plugin also supports extended configuration. If using this form, the config_file property is required to set the path for each configuration file.

- includes:
    bash:
        config_file: bash.yaml

If there are multiple configuration files in the same base directory

- includes:
    base:
        - config_file: bash.yaml
        - config_file: other.yaml

Using Defaults

This plugin applies defaults directive from the main configuration file to the execution context of each included configuration file. If an included file defines its own defaults, the one from the main configuration is skipped.

To force skip defaults from main configuration file, set the skip_defaults to True:

- defaults:
    shell:
        quiet: True

- incldues:
    bash:
        config_file: bash.yaml
        skip_defaults: True

CLI Arguments

The includes Plugin can pass CLI arguments to configuration files using the options property. If no arguments are provided, it defaults to using the arguments from the dotbot command line. (See Command-line Arguments)

For example, run only shell directive of bash.yaml:

- includes:
    bash:
        config_file: bash.yaml
        options:
            only: shell

dotbot-includes's People

Contributors

vanduc2514 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.