one line replace (le saut à la ligne casse le json)

This commit is contained in:
fred 2024-06-27 17:30:19 +02:00
parent 5e72f69921
commit 1e8de52e8b

View File

@ -415,17 +415,15 @@ for PLAYER in ${PLAYERONE[@]}; do
echo "${UPLAYERSTIDS[@]}"
UPLAYERSTIDS_STR=""
for item in "${UPLAYERSTIDS[@]}"; do
UPLAYERSTIDS_STR+="\n* $item"
UPLAYERSTIDS_STR+=" * $item \n"
done
# Trim leading space
UPLAYERSTIDS_STR="${UPLAYERSTIDS_STR# }"
######################################
# (RE)MAKE "SECTORTW_NEWS" TIDDLER
cat ${MY_PATH}/../templates/data/SECTORTW_NEWS.json \
| sed -e "s~_SECTOR_~${SECTOR}~g" \
-e "s~_MOATS_~${MOATS}~g" \
-e "s~_UPLANET_~https://qo-op.com~g" \
-e "s~_UPLAYERSTIDS_~${UPLAYERSTIDS_STR}~g" \
-z "s~_UPLAYERSTIDS_~${UPLAYERSTIDS_STR}~g" \
-e "s~_SECTORTW_~${SECTORIPNS}/TW~g" \
> ~/.zen/tmp/${MOATS}/SECTORTW_NEWS.json