Skip to content

v0.34.2

Choose a tag to compare

@github-actions github-actions released this 25 Sep 02:17
· 6 commits to main since this release

Fixes a delete that could remove your own project folder, plus several ways a failed or routine operation could lose a database or a wp-config.php. Update before deleting any attached or imported site.

Fixes

Deleting a site no longer removes a folder you own. If you had pointed the sites directory at a folder you also keep your own checkouts in (for example ~/Sites), deleting an attached site, or one imported in place, removed the whole checkout. Being inside the sites directory was treated as proof that agent-local had created the folder. Now only folders agent-local filled itself are removed. For everything else, delete restores the original wp-config.php and leaves your files where they are.

Delete only drops databases agent-local created. A site imported with --serve-only records whatever database and user its wp-config.php names. That can be another site's database, or root. Delete now leaves those in place and says so, instead of dropping them.

Your original wp-config.php backup survives WP_DEBUG and constant changes. Turning WP_DEBUG on or setting a constant overwrote wp-config.php.agent-local.bak, the copy of your config from before agent-local adopted the folder. A later delete then restored agent-local's config and lost your original credentials. Toggles now keep their rolling backup in wp-config.php.agent-local.prev, and .agent-local.bak is never rewritten.

A failed create or import no longer drops a database you kept. Re-adopting a folder after delete --keep-db reuses its database. If a later step failed, the cleanup dropped that database, which could be the only copy of the data. Cleanup now only removes what the failed call created.

wp-config.php edits keep valid PHP. Values containing $ (such as 'http://' . $_SERVER['HTTP_HOST']) or a ) (such as getenv('X') === '1') came out mangled, sometimes as a parse error that took the site down. Constants are now rewritten without touching the rest of the file, and commented-out defines are left alone.

Smaller fixes

  • An import whose database load fails now reports the error instead of hanging forever.
  • The daemon now sees sites created from the CLI straight away, instead of after some later change.
  • A crash that could take the daemon (and every site) down when branch previews changed at the same moment is gone.
  • If agent-local can't check how many tables a database has, the operation now stops with an error. Previously the automatic safety snapshot was skipped without a word.
  • A malformed update checksum file is reported as an error instead of crashing the daemon.
  • Deleting a site with --keep-files keeps its branch-preview checkouts, uncommitted work included.

Install

brew install jefrontv/tap/agent-local
# or, no Homebrew:
curl -fsSL https://raw.githubusercontent.com/jefrontv/agent-local/main/install.sh | bash

Already installed? agent-local update

First run

agent-local doctor --fix   # installs whatever is missing (PHP, MariaDB…)
agent-local sudo           # one-time: no more password prompts
agent-local create mysite