From 07244098ecbaee3996d6c325a4c79711df7ac3c8 Mon Sep 17 00:00:00 2001 From: "Florine W. Dekker" Date: Wed, 29 Nov 2023 16:12:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=B9=20mommy=20adds=20support=20for=20n?= =?UTF-8?q?ewlines=20in=20templates~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 8 ++++++++ README.md | 1 + src/main/sh/mommy | 3 ++- src/test/sh/unit_spec.sh | 9 +++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 587cfd4..83eca52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,12 @@ # Changelog +## [Unreleased] +### added +* ๐Ÿชน mommy now supports newlines in templates using `%%N%%`~ ([#58](https://github.com/FWDekker/mommy/issues/58)) ([#82](https://github.com/FWDekker/mommy/issues/82)) + +### fixed +* ๐Ÿš’ mommy fixes the description url in her manual page~ ([#81](https://github.com/FWDekker/mommy/issues/81)) ([#82](https://github.com/FWDekker/mommy/issues/82)) + + ## [1.2.6] -- 2023-11-29 ### fixed * ๐Ÿš’ mommy fixes her apt repository release script~ ([#73](https://github.com/FWDekker/mommy/issues/73)) diff --git a/README.md b/README.md index 72631b2..236d151 100644 --- a/README.md +++ b/README.md @@ -501,6 +501,7 @@ outputs `your mommy loves you`~ | `%%THEM%%` | mommy's object pronoun (e.g. him, her, them) | | `%%THEIR%%` | mommy's possessive pronoun (e.g. his, her, their) | | `%%SWEETIE%%` | what mommy calls you | +| `%%N%%` | a newline | ### โœ๏ธ renaming the mommy executable if you want to write `daddy npm test` instead of `mommy npm test`, you can create a symlink~ diff --git a/src/main/sh/mommy b/src/main/sh/mommy index b92a8bc..004940c 100755 --- a/src/main/sh/mommy +++ b/src/main/sh/mommy @@ -181,7 +181,8 @@ fill_template() { -e "s/%%THEY%%/$they/g" \ -e "s/%%THEM%%/$them/g" \ -e "s/%%THEIR%%/$their/g" \ - -e "s/%%CAREGIVER%%/$caregiver/g")" + -e "s/%%CAREGIVER%%/$caregiver/g" \ + -e "s/%%N%%/\\$n/g")" capitalize "$prefix$template$suffix" "$6" return 0 diff --git a/src/test/sh/unit_spec.sh b/src/test/sh/unit_spec.sh index 912a888..01df62d 100755 --- a/src/test/sh/unit_spec.sh +++ b/src/test/sh/unit_spec.sh @@ -358,6 +358,15 @@ Describe "mommy" The status should be success End + It "replaces %%N%%" + set_config "MOMMY_COMPLIMENTS='>bottom%%N%%stimky<'" + + When run "$MOMMY_EXEC" -c "$MOMMY_CONFIG_FILE" true + The error should equal ">bottom +stimky<" + The status should be success + End + It "prepends the prefix" set_config "MOMMY_COMPLIMENTS='<';MOMMY_PREFIX='woolen'"