blog/content/post/check-size-of-a-github-repo.md
2022-04-29 06:43:19 +00:00

1.3 KiB

title date lastmod draft keywords description tags categories author comment toc autoCollapseToc postMetaInFooter hiddenFromHomePage contentCopyright reward mathjax mathjaxEnableSingleDollar mathjaxEnableAutoNumber hideHeaderAndFooter flowchartDiagrams sequenceDiagrams
Check Size of a Github Repo 2021-02-18T14:39:57Z 2022-04-28T14:39:57Z false
size github repo repository
github
linux
false false false true false false false false false false false
enable options
false
enable options
false

Just a shell script.

Requirements: curl, jq, GNU Coreutils

#!/bin/sh
 
sizeof()
{
    curl -s https://api.github.com/repos/$1 | jq '.size' | numfmt --to=iec --from-unit=1024
}
 
size=$(sizeof $1)
echo $size

Usage

Pass username/repo as argument to the script.