diff options
author | Fedja Beader <fedja@protonmail.ch> | 2023-09-10 15:58:24 +0200 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2023-09-10 15:58:24 +0200 |
commit | 0a2d34be04d72b8982cc2cd488f7e6432d30b40b (patch) | |
tree | 8eca42bd37a93b9eae2200133dfd7ad47024ad09 /tools/ci/scripts/init.sh | |
parent | 3f68449293de30d84e39fef761ca5a4734f99c32 (diff) | |
download | manaverse-0a2d34be04d72b8982cc2cd488f7e6432d30b40b.tar.gz manaverse-0a2d34be04d72b8982cc2cd488f7e6432d30b40b.tar.bz2 manaverse-0a2d34be04d72b8982cc2cd488f7e6432d30b40b.tar.xz manaverse-0a2d34be04d72b8982cc2cd488f7e6432d30b40b.zip |
trim useless uses of cat
Diffstat (limited to 'tools/ci/scripts/init.sh')
-rwxr-xr-x | tools/ci/scripts/init.sh | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tools/ci/scripts/init.sh b/tools/ci/scripts/init.sh index 656a4d765..9512e9b66 100755 --- a/tools/ci/scripts/init.sh +++ b/tools/ci/scripts/init.sh @@ -41,10 +41,8 @@ function update_repos { echo "Running from shell. Skipping update repos" return fi - export DATA=$(cat /etc/resolv.conf|grep "nameserver 1.10.100.101") - echo "${DATA}" - if [ "$DATA" != "" ]; - then + + if grep "nameserver 1.10.100.101" /etc/resolv.conf; then echo "Detected local runner" sed -i 's!http://httpredir.debian.org/debian!http://1.10.100.103/debian!' /etc/apt/sources.list sed -i 's!http://deb.debian.org/debian!http://1.10.100.103/debian!' /etc/apt/sources.list @@ -206,9 +204,7 @@ function run_gcov { } function run_check_warnings { - DATA=$(cat $ERRFILE) - if [ "$DATA" != "" ]; - then + if [[ -s "$ERRFILE" ]]; then cat $ERRFILE exit 1 fi @@ -218,9 +214,7 @@ function run_h { rm $ERRFILE echo "$CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h" $CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h 2>$ERRFILE - DATA=$(cat $ERRFILE) - if [ "$DATA" != "" ]; - then + if [[ -s "$ERRFILE" ]]; then cat $ERRFILE exit 1 fi |