~mapperr/dfl

263db6d13b625ac1d335f05a5e808758250b730c — mapperr 5 months ago 6d55777 master
Add sync
2 files changed, 11 insertions(+), 0 deletions(-)

M README.md
M dfl
M README.md => README.md +2 -0
@@ 105,6 105,8 @@ For example, you can hack your `~/.vimrc` and do:

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

or `dfl sync`, or just `dfl y`

from wherever you are. Handy, isn't it? : )

### Jumping and dotfiles path

M dfl => dfl +9 -0
@@ 259,6 259,9 @@ Commands:
    g, git [git_arguments]
        runs git commands in the dotfiles directory

    y, sync
        commits changes, pulls and pushs current branch

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


@@ 380,6 383,12 @@ elif [ "$command" = "u" ] || [ "$command" = "up" ] || [ "$command" = "update" ];
    write_update_script
    exec /bin/bash "$update_scriptpath_abs"

elif [ "$command" = "y" ] || [ "$command" = "sync" ]; then
    cd $dotfiles_dir_abs
    git status | grep 'nothing to commit' &>/dev/null
    test $? = 1 && git add -A && git commit -am 'sync'
    git pull && git push

else
    helpmsg
fi