ChrisWiegman / kana

A simple, portable CLI for efficient WordPress development

Home Page:https://github.com/ChrisWiegman/kana-wordpress

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kana doesn't like it if there is an existing wp-config.php

dustinrue opened this issue · comments

Running kana against existing codebase that has a wp-config.php file will result in an incomplete installation. Kana will not warn about the existing file but simply move on and fail the setup.

Hi Dustin!

I'm having a hard time reproducing the this morning. Can you please tell me what I'm doing wrong with these steps?

  1. I started a new site with kana start --local
  2. Once running I killed the site (killed all the docker containers)
  3. Delete the main site from Kana's config (rm -rf ~/.config/kana/sites/test-site)
  4. Re-run kana start --local in the initial directory

Note this maintains the wordpress folder containing wp-config.php in the local folder. It starts up WordPress and finishes the install without issue. I have no problem believing there's a bug here but I fear I'm missing something in reconstructing what you're seeing.

I spoke too soon. I've been so deep into Kana-land I didn't think of changing the wp-config file.

My proposed fix (now in develop) is to look for an existing wp-config and delete it if it exists before starting the WordPress container. As the container has its own file this ensures that file is used for the install. Thoughts on that approach? It will overwrite the existing file but, I'm not sure if that is necessarily a bad thing in this context.

I've pushed the fix that overwrites with a wp-config that will work with the container (version 0.0.3). I'm going to close this for now, but I'll gladly revisit if that isn't sufficient.