Created
January 19, 2018 13:00
-
-
Save anamewing/e220af5b72b0fe92a00a1c6248b20da4 to your computer and use it in GitHub Desktop.
git export ref to json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git for-each-ref \ | |
--format='{"tag":"%(refname:short)" ,%0a "date":"%(taggerdate)" },' \ | |
refs/tags \ | |
$@ | \ | |
perl -pe 'chomp if eof;BEGIN{print "["}; END{print "]\n"}' | \ | |
perl -pe 's/},]/}]/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment