1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-08 09:39:16 +00:00

adding support for pre/post actions

This commit is contained in:
Ziirish
2018-05-31 22:33:57 +02:00
parent 018cfd6fe2
commit e04ad54c6c
4 changed files with 90 additions and 13 deletions

View File

@@ -290,6 +290,49 @@ Thus when `f_vimrc` is installed, the command
`vim +VundleClean! +VundleInstall +VundleInstall! +qall` will
be executed.
Sometimes, you may even want to execute some action prior deploying a dotfile.
Let's take another example with
[vim-plug](https://github.com/junegunn/vim-plug):
```yaml
actions:
pre:
vim-plug-install: test -e ~/.vim/autoload/plug.vim || (mkdir -p ~/.vim/autoload; curl
-fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim)
vim-plug: vim +PlugInstall +qall
config:
backup: true
create: true
dotpath: dotfiles
dotfiles:
f_vimrc:
dst: ~/.vimrc
src: vimrc
actions:
- vim-plug-install
- vim-plug
profiles:
home:
dotfiles:
- f_vimrc
```
This way, we make sure [vim-plug](https://github.com/junegunn/vim-plug)
is installed prior deploying the `~/.vimrc` dotfile.
Note: You can also define `post` actions like this:
```yaml
actions:
post:
some-action: echo "Hello, World!" >/tmp/log
```
If you don't specify neither `post` or `pre`, actions will be executed
after dotfiles deployment (which is equivalent to `post`).
## Use transformations
Transformation actions are used to transform a dotfile before it is