Repository navigation
v0.3.1
Patch release. Fixes a critical bug in mainwp init (and
mainwp config set ...) where the active profile never received
its url, api_key, and api_path.
Root cause was two compounding bugs in lib/config.sh:
mainwp_config_set_fieldbuilt a jq expression that read
.urlfrom the document root instead of writing to
.profiles[$p].url. The new value was passed via--arg v
but never referenced in the expression, so every set call
wrote the literal stringnullto the config file.mainwp_config_set_activedeclaredlocal cfg="$1"and
required a positional argument, but the init command called
it with no arguments. Combined with the brokenset_field,
the visible result wasset -u: $1: unbound variablefrom
inside the function followed by a config file containing
only{"active": "default"}.
After the fix, mainwp init stores the profile correctly and
mainwp config get round-trips the values.
Also: tests/smoke.sh now sandboxes $HOME to a temp dir for
the duration of the run. A previous run of the test suite had
polluted the real ~/.config/mainwp/config.json with the
broken null payload (same root cause); that file is wiped.
The sandbox makes the suite safe to run on a developer machine
that has a real MainWP Dashboard.
45 smoke tests, all passing. Upgrade with
`brew update && brew upgrade mainwp`.