From 8f9ea166bc0e3c13def20b391ad62d0044f9da19 Mon Sep 17 00:00:00 2001 From: jadedctrl Date: Tue, 28 Mar 2017 05:47:39 -0500 Subject: [PATCH] Optimization-- 15sec render instead of 23sec --- render.sh | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/render.sh b/render.sh index ef7749f..a4bb398 100644 --- a/render.sh +++ b/render.sh @@ -17,24 +17,17 @@ do then point_data=$(sh lib/json.sh $file | grep board/pieces/${widthi},${heighti}/ | grep =) point_data=$(echo $point_data | sed 's/ = /=/g' | sed 's/ /^/g') - echo $point_data - string_one=$(echo $point_data | sed 's/.*^//') - echo $string_one - string_two=$(echo $point_data | sed 's/^.*//') - echo $string_two - if echo $string_one | grep team= + string_one=$(echo $point_data | awk -F^ '{print $1}') + string_two=$(echo $point_data | awk -F^ '{print $2}') + if echo $string_one | grep team= > /dev/null then - team=$string_one - piece=$string_two - elif echo $string_one | grep piece= + team=$( echo $string_one | sed 's/.*=//') + piece=$(echo $string_two | sed 's/.*=//') + elif echo $string_one | grep piece= > /dev/null then - piece=$string_one - team=$string_two + piece=$(echo $string_one | sed 's/.*=//') + team=$(echo $string_two | sed 's/.*=//') fi - echo $string_one - echo $string_two - echo $piece - echo $team text=$(sh lib/json.sh -s ${team}/pieces/${piece}/text $file) else text=" "