summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2015-11-08 12:43:02 +0100
committertv <tv@krebsco.de>2015-11-08 12:43:02 +0100
commitea8b76569c6b226fe148e559477669b095408472 (patch)
tree3afedb6cbc87ddaa6820817c730c9b0743775ea4
parentc5f4bda5bd00bad7778bbd5a9af8d476de0de920 (diff)
JSON harder!
-rwxr-xr-xpush7
1 files changed, 4 insertions, 3 deletions
diff --git a/push b/push
index fc18882..8041472 100755
--- a/push
+++ b/push
@@ -20,10 +20,11 @@ my_hosts() {
}
all_push_hosts() {
- echo '{'
git remote -v \
- | sed -n 's/^\(\S\+\)\s\+git@\([^:]\+\):\(\S\+\) (push)$/"\1":{"host":"\2","repo":"\3"}/;T;$!s/$/,/;p'
- echo '}'
+ | sed -n '
+ s/^\(\S\+\)\s\+git@\([^:]\+\):\(\S\+\) (push)$/{"key":"\1","value":{"host":"\2","repo":"\3"}}/p
+ ' \
+ | jq -s from_entries
}
my_push_hosts() {