Skip to content

Commit

Permalink
reorganized files with few local lib/modules
Browse files Browse the repository at this point in the history
  • Loading branch information
robertranjan committed Apr 20, 2024
1 parent 11e93e3 commit 2155488
Show file tree
Hide file tree
Showing 10 changed files with 490 additions and 386 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.envrc*
.vscode/
bin/kpcli
*.password
*.creds
tmp/
.DS_Store
database1.out
Expand All @@ -12,3 +12,4 @@ local/
*.log
bin/
bkups/
*.csv
30 changes: 23 additions & 7 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ vars:
COMMIT_COUNT:
sh: git rev-list HEAD --count
VERSION: '{{ printf "%s.%s" .GIT_HASH .COMMIT_COUNT }}'
KDBX_BKUP_DIR: /Users/rt/Documents/RobertsFamily/backups/keepass/

tasks:
default:
Expand All @@ -19,6 +18,13 @@ tasks:
cleanup:
cmd: rm -rf ./tmp

generate-sample-config:
aliases:
- "gen"
cmds:
- |
bin/kpcli gen
add-entry:
silent: true
cmds:
Expand Down Expand Up @@ -107,28 +113,38 @@ tasks:
- |
rm -f tmp.csv diff.log
recentFile=$(ls -tl /Users/rt/Documents/RobertsFamily/backups/keepass/ | awk 'NR==2 { print $9 }')
recentFile=$(ls -tl ${KDBX_BKUP_DIR} | awk 'NR==2 { print $9 }')
echo "recentFile: ${recentFile}"
bin/kpcli --keyfile /Users/rt/Personal/password-databases/keepass-keys/RobertsFamily.key \
--database {{.KDBX_BKUP_DIR}}/${recentFile} \
bin/kpcli --keyfile ${KEYFILE} \
--database ${KDBX_BKUP_DIR}/${recentFile} \
--pass $(pass RobertsFamily.kdbx) \
ls -of csv --quite > database1.out
bin/kpcli --keyfile /Users/rt/Personal/password-databases/keepass-keys/RobertsFamily.key \
--database /Users/rt/syncWithCloud/googleDrive/keepass/RobertsFamily.kdbx \
bin/kpcli --keyfile ${KEYFILE} \
--database ${CURRENT_KDBX} \
--pass $(pass RobertsFamily.kdbx) \
ls -of csv --quite > database2.out
head -n 2 database1.out > tmp.csv
diffs=$(diff --suppress-common-lines -U0 database1.out database2.out) || true
echo "${diffs}" | grep -v '\-\-\-' | tail -n +3 >> tmp.csv
csvtable --border <tmp.csv > diff.log
csvtable <tmp.csv > diff.log
diffCount=$(grep -c . diff.log)
if [[ "${diffCount}" -gt "4" ]]; then
cat diff.log
fi
diff2:
cmds:
- |
bin/kpcli \
--keyfile ./tmp/master-db.key \
--database ./tmp/master-db.kdbx.194552000 \
--pass "${KDBX_PASSWORD}" \
diff \
--database2 ./tmp/master-db.kdbx
# release-check:
# desc: "check release tag"
# cmds:
Expand Down
Loading

0 comments on commit 2155488

Please sign in to comment.