unify the size format

This commit is contained in:
z4yx 2020-03-21 10:16:20 +08:00
parent 2e7e6150ed
commit 31ee06590b
2 changed files with 7 additions and 2 deletions

View File

@ -10,7 +10,8 @@ function update_repo_git() {
echo "==== SYNC repo.git START ===="
/usr/bin/timeout -s INT 3600 git remote -v update
git repack -a -b -d
git count-objects -v -H
sz=$(git count-objects -v|grep -Po '(?<=size-pack: )\d+')
echo "size-pack:" $(numfmt --to=iec $sz)
echo "==== SYNC repo.git DONE ===="
}

6
git.sh
View File

@ -1,5 +1,9 @@
#!/bin/bash
UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"}
UPSTREAM=${TUNASYNC_UPSTREAM_URL}
if [[ -z "$UPSTREAM" ]];then
echo "Please set the TUNASYNC_UPSTREAM_URL"
exit 1
fi
function repo_init() {
git clone --mirror $UPSTREAM $TUNASYNC_WORKING_DIR