Skip to content

Commit

Permalink
🦓 merge pull request #110 from FWDekker/slash-variable~
Browse files Browse the repository at this point in the history
🦓 mommy adds a variable for a literal slash~
  • Loading branch information
FWDekker authored Feb 26, 2024
2 parents 0d1d82d + 66c9694 commit 35b52fb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog
## [unreleased]
### added
* 🦓 mommy now supports templates with literal slashes using `%%S%%`~ ([#107](https://github.com/FWDekker/mommy/issues/107))

### changed
* 🙅‍♀️ mommy's `MOMMY_FORBIDDEN_WORDS` setting now interprets each word as a regex~ ([#103](https://github.com/FWDekker/mommy/issues/103))
* 🚀 mommy is now 4 times as fast~ ([#106](https://github.com/FWDekker/mommy/issues/106))
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ outputs `your mommy loves you`~
| `%%THEIR%%` | mommy's possessive pronoun (e.g. their, her, he) |
| `%%SWEETIE%%` | what mommy calls you |
| `%%N%%` | a newline |
| `%%S%%` | a forward slash (`/`) |
</details>
Expand Down
1 change: 1 addition & 0 deletions src/main/sh/mommy
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ fill_template() {
replace_all "$replace_all__out" "%%THEIR%%" "$their"
replace_all "$replace_all__out" "%%CAREGIVER%%" "$caregiver"
replace_all "$replace_all__out" "%%N%%" "$n"
replace_all "$replace_all__out" "%%S%%" "/"

capitalize "$prefix$replace_all__out$suffix" "$7"; fill_template__out="$capitalize__out"
return 0
Expand Down
8 changes: 8 additions & 0 deletions src/test/sh/unit_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,14 @@ stimky<"
The status should be success
End

It "replaces %%S%%"
set_config "MOMMY_COMPLIMENTS='>global%%S%%seminar<'"

When run "$MOMMY_EXEC" -c "$MOMMY_CONFIG_FILE" true
The error should equal ">global/seminar<"
The status should be success
End

It "prepends the prefix"
set_config "MOMMY_COMPLIMENTS='<';MOMMY_PREFIX='woolen'"

Expand Down

0 comments on commit 35b52fb

Please sign in to comment.