fix: asf checker and gpr

This commit is contained in:
Klesh Wong 2023-12-13 20:40:39 +08:00
parent c7b0d0014d
commit 60c9122603
2 changed files with 10 additions and 4 deletions

View File

@ -67,7 +67,7 @@ check() {
# check unexpected binary files
echo "** CHECK UNEXPRECTED BINARY FILES **"
UNEXPRECTED_BIN_FILES="$(find $SRC -type f ! -size 0 ! -name '*.png' ! -name '*.ico' -exec grep -IL . '{}' \;)"
UNEXPRECTED_BIN_FILES="$(find $SRC -type f ! -size 0 ! -name '*.jpg' ! -name '*.png' ! -name '*.ico' -exec grep -IL . '{}' \;)"
if [ -n "$UNEXPRECTED_BIN_FILES" ]; then
printf "Found unexpected binary files: \n%s\n" "$UNEXPRECTED_BIN_FILES"
else
@ -79,12 +79,17 @@ check() {
echo "** CHECK ASF HEADER **"
HEADER="$(cat $SRC/backend/.golangci-goheader.template)"
test -n "$HEADER"
for FN in $(find "$SRC" -name '*.go'); do
if ! grep -qF "$HEADER" $FN; then
OIFS="$IFS"
IFS='
'
for FN in `find "$SRC" -name '*.go'`; do
echo "$FN"
if ! grep -qF "$HEADER" "$FN"; then
echo $FN has no ASF header
exit -1
fi
done
IFS="$OIFS"
for FN in $(find "$SRC" -name '*.js' -not -path './config-ui/node_modules/*'); do
if ! cut -c4- $FN | grep -qF "$HEADER"; then
echo $FN has no ASF header
@ -95,7 +100,7 @@ check() {
echo "
+1
+1 (binding)
I checked these items:
- Download links are valid.

View File

@ -11,6 +11,7 @@ if [ -n "$PROXY_HOST" ] && [ -n "$PROXY_PORT" ]; then
fi
BRANCH=$(git branch --show-current)
# UPSTREAM_BRANCH=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} | awk -F/ '{print $2}')
UPSTREAM_BRANCH=$(HTTPS_PROXY=$HTTP_PROXY git remote show upstream | grep -oP 'HEAD branch: \K\w+')
ORIGIN_NAME=${1:-origin}
ORIGIN_URL=$(git remote get-url $ORIGIN_NAME)