github-repo-size.sh
· 239 B · Bash
Неформатований
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 owner/repo"
exit 1
fi
repo_info=$1
repo_size=$(curl -s "https://api.github.com/repos/${repo_info}" | jq '.size' | numfmt --to=iec --from-unit=1024 | tr -d '\n')
echo "${repo_size}"
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}" |
13 |