~mapperr/dfl

a7cdd37693a3efd751aa0948368869cc76b5ed5d — mapperr 4 years ago e74c126 1.1.0
Document auto override
2 files changed, 38 insertions(+), 19 deletions(-)

M README.md
M dfl
M README.md => README.md +14 -4
@@ 37,6 37,8 @@ It's a handy directory to gitignore, if your `dotfiles` is a git repo.

### Overrides

Or 'profiles' if it suits you better.

If you need some 'overrides', put them in a new directory,
e.g. `dotfiles/fluxbox`, and pass it to the script as an argument,
like this:


@@ 51,6 53,14 @@ A use case is when you have another pc/server and you need a slightly different 
that translates in you need some dotfiles to have different content than the usual.


### Auto override

You can make dfl choose a profile automatically so that you don't have
to remember to type it if you set the env var `DFL_OVERRIDE`.
If `dfl` does not find that var, it checks if there is a profile dir named
as the output of the hostname command and take that as the profile.


### Tracking

`dfl` tracks the links it creates,


@@ 84,14 94,14 @@ After that you only need to link them up with `dfl l`.
If you have your dotfiles on some git repo you can do a `dfl clone <your repo>`.
It will clone you repo in the `dotfiles` dir, backupping the existing one.

If you cloned your repo, moved from another directory or just `git init` it
you can commit and push your dotfiles directly with `dfl`:
So, if your dotfiles dir is a git repo you can commit and push your dotfiles
directly with `dfl`:

`dfl git <whatever git command and arguments>`

it `cd` in your `dotfiles` directory and execute the `git` part.
it `cd`s in your `dotfiles` directory and executes the `git` part.

So you can hack your `~/.vimrc` and do:
For example, you can hack your `~/.vimrc` and do:

`dfl g commit -am 'Add awesomeness' && dfl g push`


M dfl => dfl +24 -15
@@ 248,27 248,36 @@ process_profile() {

helpmsg() {
    echo "Usage: `basename $0` [-v] <command>
    Commands:
        l, link [profile_name]
            links dotfiles in default, secrets and, eventually, profile_name directories, in this order
Commands:
    l, link [profile_name]
        links dotfiles in default, secrets and, eventually,
        profile_name directories, in this order

        t, take filename|dirname [profile_name]
            move the file (or directory) into your dotfiles, in the specified profile directory, or in default if its omitted
    t, take filename|dirname [profile_name]
        move the file (or directory) into your dotfiles,
        in the specified profile directory, or in default if its omitted

        g, git [git_arguments]
            runs git commands in the dotfiles directory
    g, git [git_arguments]
        runs git commands in the dotfiles directory

        clone <git repository>
            clone a git repo in the dotfile directory, backupping the eventual existing one
    clone <git repository>
        clone a git repo in the dotfile directory,
        backupping the eventual existing one

        d
            prints the dotfiles directory absolute path
    d
        prints the dotfiles directory absolute path

        u, up, update
            self update from [$script_url]
    u, up, update
        self update from [$script_url]

    Options:
        -v  -  activate verbose mode
Options:
    -v  -  activate verbose mode

Auto profile:
    you can make dfl choose a profile automatically so that you don't have
    to remember to type it if you set the env var DFL_OVERRIDE.
    If dfl does not find that var, it checks if there is a profile dir named
    as the output of the hostname command and take that as the profile.
"
}