[Mac] Unsupported grep flags used in `MOODLE_DOCKER_APP_RUNTIME` inference
The script implemented to guess the MOODLE_DOCKER_APP_RUNTIME env variable is using some flags that are not supported in Mac. It can be confusing because no error is thrown, instead the following message appears when running moodle-docker-compose:
$ bin/moodle-docker-compose exec webserver php admin/tool/behat/cli/init.php
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
The workaround for now is just to explicitly initialize the MOODLE_DOCKER_APP_RUNTIME variable in your local environment.
I noticed this too. It looks like the -P (--perl-regexp) flag is not supported by grep on MacOS. This is used in several places in the bin/moodle-docker-compose file.
Thanks for suggesting the workaround @NoelDeMartin
Side note, I'd suggest to install GNU grep (and others, surely). That can be done both with:
- homebrew: https://formulae.brew.sh/formula/grep
- macports: https://ports.macports.org/port/grep/
Just in case you're already using any of them.
Ciao :-)