From d62b8ca11d91b578aead0d0643a1f15f37a5be64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 13 Jun 2022 21:35:28 +0200 Subject: [PATCH] Add passwordstore extraction tool --- bin/pf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/pf diff --git a/bin/pf b/bin/pf new file mode 100755 index 0000000..cf53010 --- /dev/null +++ b/bin/pf @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import sys +import json +import yaml +import subprocess + +jqexpression = sys.argv[1] + +jqprocess = subprocess.Popen(["jq", "-r", jqexpression], stdin=subprocess.PIPE, text=True) + +document = [d for d in yaml.safe_load_all(sys.stdin)][-1] + +json.dump(document, jqprocess.stdin)