diff --git a/.bashrc b/.bashrc index dd26f76..4300d1f 100644 --- a/.bashrc +++ b/.bashrc @@ -52,5 +52,9 @@ bash ~/.motd # quick writing funcs function unlock() { export SOPS_AGE_KEY=$(age -d ${HOME}/.age/privkey.age); } function write() { SOPS_AGE_KEY=${SOPS_AGE_KEY} EDITOR='vim -c "Goyo"' sops $1; } -function j() { SOPS_AGE_KEY=${SOPS_AGE_KEY} EDITOR='vim -c "Goyo"' sops ${HOME}/journal/$(date +%Y%m%d).txt; } +function j() { + JDIR=${HOME}/journal/$(date +%Y%m)/ + mkdir -p ${JDIR} + SOPS_AGE_KEY=${SOPS_AGE_KEY} EDITOR='vim -c "Goyo"' sops ${JDIR}/$(date +%d).txt +} function lock() { unset SOPS_AGE_KEY; }