Skip to content

Commit

Permalink
merge pull request #4 from FWDekker/dev~ 🧡
Browse files Browse the repository at this point in the history
0.0.3
  • Loading branch information
FWDekker committed Jan 29, 2023
2 parents b4df846 + 9407dcb commit b9ef280
Show file tree
Hide file tree
Showing 9 changed files with 636 additions and 178 deletions.
1 change: 1 addition & 0 deletions .shellspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--execdir @specfile
141 changes: 94 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,120 @@
# mommy
mommy's here to support you~ ❤️

## Installation
Download the [latest release](https://github.com/FWDekker/mommy/releases/latest) for your platform and install as usual~

For example, on Debian-like systems (including Ubuntu), run
```shell
sudo apt install ./mommy-0.0.2.deb
```

## Usage
Run any command you want, but prepend it with `mommy`~

```shell
$> mommy npm test
$ mommy npm test

> little-girls-tests@1.4.13 test
> mocha -r ts-node/register -r jsdom-global/register src/**/*.spec.ts
[bunch of failing tests here]

mommy knows her little girl can do better~
```

## usage
put `mommy` before any command you want to run and mommy displays a compliment if it succeeds and an encouraging message
if it fails~

my tests :3
1) maths
alternatively, use `mommy -e` to evaluate the string as a command, as in `mommy -e "npm test"`~

```shell
$ mommy true
good girl~
```

0 passing (8ms)
1 failing
```shell
$ mommy false
mommy knows her little girl can do better~
```

1) my tests :3
maths:
```shell
$ mommy -e "command1 | command2 | command 3 | command 4"
[if any command fails]
mommy knows her little girl can do better~
```

AssertionError: expected 7 to equal 6
+ expected - actual
```shell
$ mommy -e "command1 | command2 | command 3 | command 4"
[if all commands succeed]
good girl~
```

-7
+6

at Context.<anonymous> (src/test/Path.spec.ts:10:26)
at processImmediate (node:internal/timers:471:21)
## configuration
mommy will carefully read the following variables from `~/.config/mommy/config.sh` (override using
`mommy -c ./my_config`)
to give you the bestest messages~
* `MOMMY_PET_NAME` is what mommy calls you~
* `MOMMY_PRONOUN` is what mommy uses for themselves~
* `MOMMY_ROLE` is how mommy calls themselves~
* `MOMMY_SUFFIX` is how mommy will end all their messages~
* `MOMMY_CAPITALIZE` is `0` if mommy should start her sentences in lowercase, `1` for uppercase, and anything else to
change nothing~
* `MOMMY_COMPLIMENTS` is the compliment mommy should give you if you did a good job~
* `MOMMY_COMPLIMENTS_EXTRA` is where you can add your own compliments without removing the default ones~
* `MOMMY_ENCOURAGEMENTS` is the encouragement mommy should give you if you need help~
* `MOMMY_ENCOURAGEMENTS_EXTRA` is where you can add your own encouragements without removing the default ones~

all these options take a `/`-separated list, and mommy will select the one they feel like using whenever they talk
to you~

in custom compliments and encouragements, you can ask mommy to use variables `%%PET_NAME%%`, `%%PRONOUN%%`, and
`%%ROLE%%`~
be careful with trailing newlines because mommy doesn't remove those for you~

for example, if the config file looks like
```shell script
MOMMY_PET_NAME="boy/pet/baby"
MOMMY_PRONOUN="his/their"
MOMMY_ROLE="daddy"
MOMMY_SUFFIX="~/ :3/"
MOMMY_COMPLIMENTS_EXTRA="great job little %%PET_NAME%%/%%ROLE%% is proud of you"
MOMMY_ENCOURAGEMENTS_EXTRA="\
/%%ROLE%% is here for you\
/%%ROLE%% will always love you\
/%%ROLE%% is here if you want a hug"
```
then mommy might compliment you with any of
* daddy loves his little baby~
* great job little baby :3
* daddy is proud of you

and so on~

### renaming mommy
if you don't want a mommy but for example a daddy, run the following:
```shell
sudo ln -s /usr/bin/mommy /usr/bin/daddy
sudo ln -s /usr/share/man/man1/mommy.1 /usr/share/man/man1/daddy.1
```

if you update mommy, then your daddy will also be updated, but if you uninstall mommy, you should manually uninstall
your daddy by running
```shell
sudo rm /usr/bin/daddy
sudo rm /usr/share/man/man1/daddy.1
```

mommy knows her little girl can do better~ ❤
## installation
download the [latest release](https://github.com/FWDekker/mommy/releases/latest) for your platform and install as usual~

for example, on Debian-like systems (including Ubuntu), run
```shell
sudo apt install ./mommy-0.0.3.deb
```
and then run `mommy [your command]`~

## Configuration
Mommy will carefully read `~/.config/mommy/config.sh` to give you the bestest messages~
to uninstall, just do `sudo apt remove mommy`~

* `MOMMY_LITTLE` is what mommy calls you~ (default: "girl")
* `MOMMY_PRONOUNS` is what mommy uses for themselves~ (default: "her")
* `MOMMY_ROLES` is what mommy's role will be~ (default: "mommy")
## development
to build your own mommy, just run `./build.sh`, and outputs appear in `dist/`~

All these options can take a `/`-separated list, and mommy will select the one she feels like using whenever she talks to you~

For example, if the file `~/.config/mommy/config.sh` looks like
to install the requirements on a Debian-like machine, run
```shell
MOMMY_LITTLE=boy/pet/baby
MOMMY_PRONOUNS=his/their
MOMMY_ROLES=daddy
sudo gem install fpm
sudo apt install build-essential squashfs-tools rpm
```
then mommy might say any of
* `daddy loves his little baby~ ❤`
* `daddy loves their little pet~ ❤`
* `daddy loves their little boy~ ❤`

## Development
All you need to build your own mommy is `build-essential`, `rpm`, and `squashfs-tools`, and then you just run `build.sh`~
for a new release, make sure to update `./version` and update the date in `src/main/resources/mommy.1`~

to run tests, install [shellspec](https://github.com/shellspec/shellspec) and run `shellspec src/test/sh/mommy_spec.sh`~

## Acknowledgements
Mommy was very much inspired by [cargo-mommy](https://github.com/Gankra/cargo-mommy)~
## acknowledgements
mommy was very much inspired by [cargo-mommy](https://github.com/Gankra/cargo-mommy)~
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ rm -rf build/
rm -rf dist/

# Prepare build
cp -r src/ build/
cp -r src/main/sh/ build/
cp -r src/main/resources/ build/
find build/ -type f -exec sed -i "s/%%VERSION_NUMBER%%/$version/g" {} \;

# Build packages
mkdir dist/

for target in apk deb rpm sh tar; do
echo "# Build $target"
fpm -t $target -p dist/mommy-$version.$target --version $version
fpm -t "$target" -p "dist/mommy-$version.$target" --version "$version"
done
110 changes: 110 additions & 0 deletions src/main/resources/mommy.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
.TH MOMMY "1" "2023-01-29" "mommy %%VERSION_NUMBER%%" "User Commands"


.SH NAME
mommy - here to support you~


.SH SYNOPSIS
\fBmommy\fP [\fB\-c\fP \fIconfig\fP] \fIcommand\fP ...
.br
\fBmommy\fP [\fB\-c\fP \fIconfig\fP] \fB-e\fP \fIeval\fP


.SH DESCRIPTION
\fBmommy\fP displays a compliment when \fIcommand\fP succeeds and an encouraging message when \fIcommand\fP fails~

alternatively, instead of running the vararg \fIcommand\fP, \fBmommy\fP evaluates the command in \fIeval\fP

.PP
\fBmommy\fP will carefully read the following variables from \fI~/.config/mommy/config.sh\fP (override with
\fIconfig\fP) to give you the bestest messages~ ❤
.br
* \fIMOMMY_PET_NAME\fP is what \fBmommy\fP calls you~
.br
* \fIMOMMY_PRONOUN\fP is what \fBmommy\fP uses for themselves~
.br
* \fIMOMMY_ROLE\fP is how \fBmommy\fP calls themselves~
.br
* \fIMOMMY_SUFFIX\fP is how \fBmommy\fP will end all their messages~
.br
* \fIMOMMY_CAPITALIZE\fP is `0` if \fBmommy\fP should start her sentences in lowercase, `1` for uppercase, and anything
else to change nothing~
.br
* \fIMOMMY_COMPLIMENTS\fP is the compliment \fBmommy\fP should give you if you did a good job~
.br
* \fIMOMMY_COMPLIMENTS_EXTRA\fP is where you can add your own compliments without removing the default ones~
.br
* \fIMOMMY_ENCOURAGEMENTS\fP is the encouragement \fBmommy\fP should give you if you need help~
.br
* \fIMOMMY_ENCOURAGEMENTS_EXTRA\fP is where you can add your own encouragements without removing the default ones~
.br
all these options take a /-separated list, and \fBmommy\fP will select the one they feel like using whenever they talk
to you~

.PP
in custom compliments and encouragements, you can ask \fBmommy\fP to use variables \fI%%PET_NAME%%\fP,
\fI%%PRONOUN%%\fP, and \fI%%ROLE%%\fP~
be careful with trailing newlines because \fBmommy\fP doesn't remove those for you~

.PP
for example, if the \fIconfig\fP looks like
.RS
.br
\fIMOMMY_PET_NAME\fP="boy/pet/baby"
.br
\fIMOMMY_PRONOUN\fP="his/their"
.br
\fIMOMMY_ROLE\fP="daddy"
.br
\fIMOMMY_SUFFIX\fP="~/ :3/"
.br
\fIMOMMY_COMPLIMENTS_EXTRA\fP="great job little %%PET_NAME%%/%%ROLE%% is proud of you"
.br
\fIMOMMY_ENCOURAGEMENTS_EXTRA\fP="\\
.br
%%ROLE%% is here for you\\
.br
/%%ROLE%% will always love you\\
.br
/%%ROLE%% is here if you want a hug"
.RE
then \fBmommy\fP might compliment you with any of
.br
* daddy loves his little baby~
.br
* great job little baby :3
.br
* daddy is proud of you
.br
and so on~


.SH EXAMPLES
.PP
$ mommy true
.br
good girl~

.PP
$ mommy false
.br
mommy knows her little girl can do better~

.PP
$ mommy "command1 | command2 | command 3 | command 4"
.br
[if any command fails]
.br
mommy knows her little girl can do better~

.PP
$ mommy "command1 | command2 | command 3 | command 4"
.br
[if all commands succeed]
.br
good girl~


.SH BUGS
https://github.com/FWDekker/mommy/issues
Loading

0 comments on commit b9ef280

Please sign in to comment.