From 1a5abfc580bf916bbc54cd694b1010bd097c04ff Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Wed, 1 Apr 2020 16:07:36 +0300 Subject: [PATCH] fix multiline warnings --- xcode/build_phases/copy_paste_detection.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xcode/build_phases/copy_paste_detection.sh b/xcode/build_phases/copy_paste_detection.sh index a8a167a..d1ead79 100644 --- a/xcode/build_phases/copy_paste_detection.sh +++ b/xcode/build_phases/copy_paste_detection.sh @@ -8,12 +8,12 @@ if which pmd >/dev/null; then pmd cpd --files ${SOURCES_DIR} --exclude ${FILES_TO_EXCLUDE} --minimum-tokens 50 --language swift --encoding UTF-8 --format net.sourceforge.pmd.cpd.XMLRenderer > ${REPORTS_DIR}/cpd-output.xml --failOnViolation true - # running script - readonly WARNINGS=$(php ./build-scripts/xcode/aux_scripts/cpd_script.php ${REPORTS_DIR}/cpd-output.xml) + php ./build-scripts/xcode/aux_scripts/cpd_script.php ${REPORTS_DIR}/cpd-output.xml | tee ${REPORTS_DIR}/CPDLog.txt + # Make paths relative to SOURCES_DIR, so different developers won't rewrite entire file readonly SED_REPLACEMENT_STRING=$(echo ${SOURCES_DIR} | sed "s/\//\\\\\//g") - echo ${WARNINGS} | sed "s/${SED_REPLACEMENT_STRING}//" > ${REPORTS_DIR}/CPDLog.txt - echo ${WARNINGS} + + sed -i '' "s/${SED_REPLACEMENT_STRING}//g" "${REPORTS_DIR}/CPDLog.txt" else echo "warning: pmd not installed, install using 'brew install pmd'" exit 1