mirror of
https://git.adityakumar.xyz/sizeof.git
synced 2024-11-21 21:12:54 +00:00
initial commit
This commit is contained in:
commit
6b62c2395c
2 changed files with 16 additions and 0 deletions
8
README.md
Normal file
8
README.md
Normal file
|
@ -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
|
8
sizeof.sh
Normal file
8
sizeof.sh
Normal file
|
@ -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
|
Loading…
Reference in a new issue