[gjs: 3/4] maint: pacify CI script static analysis



commit e55133349583a507abe9412a9137b94e419915a8
Author: Claudio André <claudioandre br gmail com>
Date:   Sun Mar 4 13:06:30 2018 -0300

    maint: pacify CI script static analysis

 test/test-ci.sh | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/test/test-ci.sh b/test/test-ci.sh
index ea3666f..9ecdf23 100755
--- a/test/test-ci.sh
+++ b/test/test-ci.sh
@@ -5,9 +5,10 @@ function do_Set_Env(){
     echo '-- Set Environment --'
 
     #Save cache on $pwd (required by artifacts)
-    mkdir -p $(pwd)/.cache
-    export XDG_CACHE_HOME=$(pwd)/.cache
-    cp -r /cwd/.cache $(pwd)/.cache
+    mkdir -p "$(pwd)"/.cache
+    XDG_CACHE_HOME="$(pwd)"/.cache
+    export XDG_CACHE_HOME
+    cp -r /cwd/.cache "$(pwd)"/.cache
 
     export JHBUILD_RUN_AS_ROOT=1
     export SHELL=/bin/bash
@@ -62,10 +63,10 @@ echo "Doing: $1"
 source test/extra/do_jhbuild.sh
 
 # Create the artifacts folders
-mkdir -p $(pwd)/coverage; touch $(pwd)/coverage/doing-"$1"
-mkdir -p $(pwd)/cppcheck; touch $(pwd)/cppcheck/doing-"$1"
-mkdir -p $(pwd)/tokei; touch $(pwd)/tokei/doing-"$1"
-save_dir=$(pwd)
+save_dir="$(pwd)"
+mkdir -p "$save_dir"/coverage; touch "$save_dir"/coverage/doing-"$1"
+mkdir -p "$save_dir"/cppcheck; touch "$save_dir"/cppcheck/doing-"$1"
+mkdir -p "$save_dir"/tokei; touch "$save_dir"/tokei/doing-"$1"
 
 if [[ $1 == "GJS" ]]; then
     do_Set_Env
@@ -113,11 +114,11 @@ elif [[ $1 == "GJS_COVERAGE" ]]; then
     PATH=$PATH:~/.local/bin
 
     jhbuild run --in-builddir=gjs make check-code-coverage
-    cp $(pwd)/.cache/jhbuild/build/gjs/gjs-?.*.*-coverage.info $(pwd)/coverage/
-    cp -r $(pwd)/.cache/jhbuild/build/gjs/gjs-?.*.*-coverage/* $(pwd)/coverage/
+    cp "$(pwd)"/.cache/jhbuild/build/gjs/gjs-?.*.*-coverage.info "$save_dir"/coverage/
+    cp -r "$(pwd)"/.cache/jhbuild/build/gjs/gjs-?.*.*-coverage/* "$save_dir"/coverage/
 
     echo '-----------------------------------------------------------------'
-    sed -e 's/<[^>]*>//g' $(pwd)/coverage/index.html | tr -d ' \t' | grep -A3 -P '^Lines:$'  | tr '\n' ' '; 
echo
+    sed -e 's/<[^>]*>//g' "$(pwd)"/coverage/index.html | tr -d ' \t' | grep -A3 -P '^Lines:$'  | tr '\n' ' 
'; echo
     echo '-----------------------------------------------------------------'
 
 elif [[ $1 == "CPPCHECK" ]]; then


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]