mirror of
https://github.com/Xevion/dotfiles.git
synced 2025-12-15 10:11:38 -06:00
Standardize hooks, add better key.txt bootstrapper, add update hook to detect --init
This commit is contained in:
11
home/hooks/.init_pre.sh
Executable file
11
home/hooks/.init_pre.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# note: CHEZMOI_UPDATE will be set if this was invoked indirectly by 'chezmoi update --init'
|
||||
set -eu
|
||||
|
||||
# While key.txt is managed by Chezmoi, it's required for encrypted operations and needed to bootstrap other operations.
|
||||
if [ ! -f ~/key.txt ]; then
|
||||
rbw get "key.txt (age)" --field notes >>~/key.txt
|
||||
rbw get "key.txt (age)" --field password >>~/key.txt
|
||||
echo "key.txt bootstrapped"
|
||||
fi
|
||||
Reference in New Issue
Block a user