Categories
CLI Coding WordPress

Ergonomically Running WP-CLI in wp-env

Something that has always annoyed me is how verbose it is to run WP-CLI commands in wp-env projects. For example, to list out all posts: The “npm run wp-env run cli” part I have to copy for each command, and I often forget the right order or miss a component. It gets worse when needing […]

Categories
CLI WordPress

Repairing wp-env’s Testing Database

Sometimes when I interrupt PHP unit tests in a wp-env environment I end up getting the database in a bad state so that the next time I try to run tests I get: I then have to re-remember what I do to fix this every time, so I’m blogging it so I won’t have to […]

Categories
CLI

Creating command aliases for Lando tooling

I’m a big fan of Lando. Since first learning about it, I’ve switched from using a virtual machine with Vagrant (i.e. VVV) to using Docker containers for my day-to-day local development environment. Docker on its own is not the most ergonomic (at least, I’m not an expert), so wrappers like Local by Flywheel make it […]

Categories
CLI

Quick check if merge will break the build

Quickly check from feature branch if merging will break the target branch (e.g. develop): git merge –no-commit develop .git/hooks/pre-commit # assuming you added this hook git merge –abort