diff options
-rwxr-xr-x | push | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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() { |