sudofox / shell-mommy

Mommy is here for you on the command line ~ ❤️
392 stars 15 forks source link

Change Function Definition To Limit Scope #14

Closed ChristianSilvermoon closed 1 year ago

ChristianSilvermoon commented 1 year ago

This is probably the tiniest pull request I've ever made, but I felt it was important.

Currently, Shell Mommy doesn't do a very good job keeping your variables and functions too tidy, things like success() and failure() remain defined in the main shell once mommy() has been called once... additionally, several variables such as $DEF_WORDS_LITTLE and $DEF_WORDS_ROLES also remain defined as well...

Since Mommy doesn't really alter anything outside of her scope, she can help you keep your room shell clean by working in a subshell instead.

Yes, this PR changes just two characters, but they are two characters of great power :3

sudofox commented 1 year ago

I tested this and it seems to work alright. I might need to check if one of my other projects, melee.sh, has the same issue.