From e3534b12b3776752e6ea33a1be4d96781394a093 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Tue, 28 Aug 2018 10:33:31 +0200 Subject: [PATCH] MON-294 persist specificities in declaration example for readme --- scripts/02_update_readme.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/02_update_readme.sh b/scripts/02_update_readme.sh index ea8e6a5..025ed2d 100755 --- a/scripts/02_update_readme.sh +++ b/scripts/02_update_readme.sh @@ -31,6 +31,7 @@ for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors module_space=${module^^} module_dash=${module//[ ]/-} module_slash=${module//[ ]/\/} + cat < README.md # ${module_space} DataDog monitors @@ -42,6 +43,13 @@ module "datadog-monitors-${module_dash}" { environment = "\${var.environment}" message = "\${module.datadog-message-alerting.alerting-message}" +EOF + + if [[ $EXIST -eq 1 ]]; then + sed -n '/^[[:space:]]*message[[:space:]]*=.*/,/^\}/p' README.md.bak | tail -n +2 | head -n -1 >> README.md + fi + + cat <> README.md } \`\`\`