My personal YADM hooks, used to automate and/or improve some functionalities from YADM. For details on YADM hooks, check the documentation here.
This hook performs two actions after running the command yadm encrypt
:
-
Calculate the SHA256 checksum of all files listed under
.yadm/encrypt
; backup sum file to.yadm/encrypted.sha256sum.old
; store these values in.yadm/encrypted.sha256sum
; -
Stage the list of encrypted files, the sha256sum file and the
.yadm/files.gpg
encrypted file set.
Since YADM does not support a normal .gitignore file, I had to hack my way into this: by creating a file called .yadm/ignore
and copying it to the .yadm/repo.git/info/exclude
. Because Git does not support this file to be a Symlink, this hook checks if both files are different (using diff) and, if yes, copies .yadm/ignore
on top of .yadm/repo.git/info/exclude
.
About files utils.sh
and utils.py
, they hold helper functions for the hooks. The reason for two files is that the GLOB functionality was easier to write in Python than in Shell...