commit 6b62c2395c398308ac64267cd9ae553000551619 Author: Aditya Date: Wed May 4 14:16:16 2022 +0530 initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..3397583 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# sizeof +print size of a github repo + +## Requirements +jq, curl, GNU coreutils + +## Usage +pass `username/repo` as argument to the script diff --git a/sizeof.sh b/sizeof.sh new file mode 100644 index 0000000..592651e --- /dev/null +++ b/sizeof.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +sizeof() { + curl -s https://api.github.com/repos/$1 | jq '.size' | numfmt --to-iec --from-unit=1024 +} + +size=$(sizeof $1) +echo $size