forked from Riesi/frog_emojis_old
[CI] optimize action
This commit is contained in:
parent
b74c472be8
commit
5b9c105fff
|
@ -16,7 +16,7 @@ jobs:
|
||||||
# Enables globstar to recursively go through folders
|
# Enables globstar to recursively go through folders
|
||||||
shopt -s globstar
|
shopt -s globstar
|
||||||
errArr=()
|
errArr=()
|
||||||
for f in ./**/*.svg
|
for f in ./svg/**/*.svg
|
||||||
do
|
do
|
||||||
echo "Checking '$f'"
|
echo "Checking '$f'"
|
||||||
|
|
||||||
|
@ -25,8 +25,10 @@ jobs:
|
||||||
errArr+=("$f contains a space!")
|
errArr+=("$f contains a space!")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Save first few lines of file into variable to make parsing faster
|
||||||
|
headfile=$(head -n 50 "$f")
|
||||||
# Gets everything in between the viewBox quotes
|
# Gets everything in between the viewBox quotes
|
||||||
vbStr=$(cat $f)
|
vbStr=${headfile}
|
||||||
vbStr=${vbStr##*viewBox=\"}
|
vbStr=${vbStr##*viewBox=\"}
|
||||||
vbStr=${vbStr%%\"*}
|
vbStr=${vbStr%%\"*}
|
||||||
|
|
||||||
|
@ -49,7 +51,7 @@ jobs:
|
||||||
|
|
||||||
# Check if normal width/height parameters exist and
|
# Check if normal width/height parameters exist and
|
||||||
# if yes, compare them with viewBox height/width
|
# if yes, compare them with viewBox height/width
|
||||||
svgTags=$(cat $f)
|
svgTags=${headfile}
|
||||||
svgTags=${svgTags##*\<svg}
|
svgTags=${svgTags##*\<svg}
|
||||||
svgTags=${svgTags%%\>*}
|
svgTags=${svgTags%%\>*}
|
||||||
|
|
||||||
|
@ -72,7 +74,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that svg is not 1 line
|
# Check that svg is not 1 line
|
||||||
if [[ $(wc -l < $f) == 0 ]] ; then
|
if [[ $(wc -l < "$f") == 0 ]] ; then
|
||||||
errArr+=("$f is only one line!")
|
errArr+=("$f is only one line!")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue