Skip to content

Commit

Permalink
🪹 mommy adds support for newlines in templates~
Browse files Browse the repository at this point in the history
  • Loading branch information
FWDekker committed Nov 29, 2023
1 parent 867a3a7 commit 0724409
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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~
Expand Down
3 changes: 2 additions & 1 deletion src/main/sh/mommy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/test/sh/unit_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'"

Expand Down

0 comments on commit 0724409

Please sign in to comment.