crypt.sh: add delete and create file func

This commit is contained in:
Mateusz Słodkowicz 2024-03-03 13:20:02 +01:00
parent 24885efdb4
commit 81d7fdfec1
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
1 changed files with 15 additions and 1 deletions

View File

@ -21,6 +21,10 @@ create_decrypt () {
git add --intent-to-add decrypted git add --intent-to-add decrypted
git update-index --assume-unchanged decrypted git update-index --assume-unchanged decrypted
} }
delete_decrypt () {
rm decrypted
git rm decrypted
}
if [ $# = 1 ]; then if [ $# = 1 ]; then
@ -32,11 +36,21 @@ if [ $# = 1 ]; then
fi fi
if [ $1 = "lock" ]; then if [ $1 = "lock" ]; then
rm decrypted delete_decrypt
git-crypt lock git-crypt lock
exit exit
fi fi
if [ $1 = "create_decrypt" ]; then
create_decrypt
exit
fi
if [ $1 = "delete_decrypt" ]; then
delete_decrypt
exit
fi
fi fi
if [ $# = 2 ] && [ $1 = "unlock" ]; then if [ $# = 2 ] && [ $1 = "unlock" ]; then