Based on Jess Archer's script, this executes a command within a
specified Docker Compose service or, if no matching one is not found,
will execute it locally.
Create a `export-video-list` script that exports all the video files on
my external hard drive to a JSON file so I can easily see what videos I
have without needing to get and plug in the drive.
I can easily view it using `bat` or `jq` and combine it with `grep` to
search for a specific video - e.g. `cat ~/video.json | grep -i nix`
(`-i` makes the search case-insensitive).
Make the `run` command cleverer by also searching for a `.ignored/run`
file, following the convention of always ignoring a `.ignored` directory
from Git.
This allows me to have a local `run` file that doesn't need to be
committed and pushed to the repo (e.g. it's too specific to me), and
being able to keep it outside of the root of the project directory where
it could be committed accidentally.
A similar approach was done by Andreas Möller using Makefiles in this
article:
https://localheinz.com/articles/2020/05/07/using-makefiles-in-projects-where-i-can-not-use-them
With this function, the `.ignored/run` file is executed if it's found
and exits with the status code of the command.
If not, it will fall back to using `./run` as before.
I considered reversing these and checking for `./run` first as there
could be a performance benefit but, if neither file is found, I want the
error to show `./run` and not `.ignored/run` as that's the main use
case.
Add `xdg-utils` to add functions like `xdg-open` to run commands such
as `mob timer open` and have them open a browser.
Also add `wsl-open` so this works within WSL.