1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-10 17:24:15 +00:00

add ability to patch template with update (#82)

This commit is contained in:
deadc0de6
2019-02-03 15:11:58 +01:00
parent 4acc83f91f
commit 84b2f98525
5 changed files with 154 additions and 7 deletions

View File

@@ -508,7 +508,7 @@ $ git diff
**The dotfile uses [templating](#template)**
The dotfile must be manually updated, two solutions can be used to identify the
The dotfile must be manually updated, three solutions can be used to identify the
changes to apply to the template:
* Use dotdrop's `compare` command
@@ -517,6 +517,15 @@ changes to apply to the template:
$ dotdrop compare --file=~/.vimrc
```
* Provide the switch `-P --show-patch` that will provide with an ad-hoc solution
to manually patch the template file using a temporary generated version of the template
(this isn't a bullet proof solution and might need manual checking)
```bash
./dotdrop.sh update --show-patch ~/.vimrc
[WARN] /home/user/dotfiles/vimrc uses template, update manually
[WARN] try patching with: "diff -u /tmp/dotdrop-sbx6hw0r /home/user/.vimrc | patch /home/user/dotfiles/vimrc"
```
* Install the dotfiles to a temporary directory (using the `install` command and the
`-t` switch) and compare the generated dotfile with the local one.
```bash