最后活跃于 1723864300

Get repo size from GitHub API

Vinfall 修订了这个 Gist 1723864300. 转到此修订

1 file changed, 0 insertions, 0 deletions

github-repo-size 重命名为 github-repo-size.sh

文件已重命名,但内容与之前没有差异

Vinfall 修订了这个 Gist 1723864287. 转到此修订

1 file changed, 12 insertions

github-repo-size(文件已创建)

@@ -0,0 +1,12 @@
1 + #!/bin/bash
2 +
3 + if [ $# -ne 1 ]; then
4 + echo "Usage: $0 owner/repo"
5 + exit 1
6 + fi
7 +
8 + repo_info=$1
9 +
10 + repo_size=$(curl -s "https://api.github.com/repos/${repo_info}" | jq '.size' | numfmt --to=iec --from-unit=1024 | tr -d '\n')
11 +
12 + echo "${repo_size}"
上一页 下一页