From 50b081827365da913c07917afdd8867894d6ad75 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 11:03:24 -0400 Subject: try conditional check in bash --- Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e3ae91e..714ca41 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,10 @@ pipeline { source /home/tgrogers-raid/a/common/gpgpu-sim-setup/common/export_gcc_version.sh 5.3.0 git remote add upstream https://github.com/purdue-aalp/gpgpu-sim_distribution git fetch upstream - git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /tmp/clang-format + cpp_diff= $(git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp") + if [[ $cpp_diff ]]; then + git diff --name-only upstream/dev | grep -E "*.cc|*.h|*.cpp|*.hpp" | xargs ./run-clang-format.py --clang-format-executable /tmp/clang-format + fi ''' } } -- cgit v1.3