Answers:
使用Github API:
$ echo https://github.com/hlamer/enki.git | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -i curl -s -k https://api.github.com/repos/'{}' | grep size
"size": 284,
-i
用于的参数xargs
,因此为:$ echo https://github.com/hlamer/enki.git | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -I{} curl -s -k https://api.github.com/repos/'{}' | grep size