getkirby / cli

Kirby Command Line Interface
MIT License
52 stars 5 forks source link

Look for public paths and load index from there if they exist #17

Closed samzzi closed 1 year ago

samzzi commented 2 years ago

As noted in #12 public folder setups have problems working with the CLI because it doesn't look for the correct index.php.

This PR should fix this by scanning all the first level folders for an index.php and hold them against the "well known" public html folders (www|public|public_html) and load the index.php from there. If none of these exist the index.php will be loaded from root.

Tested on default plainkit and plainkit with www/public/public_html setups.

Feel free to let me know if you'd rather see this done in another way. For example just checking the folders with an exist on index.php in a for each.

I'd like to get this show on the road se we can start building Kirby CLI plugins 😇

bastianallgeier commented 1 year ago

I implemented it slightly differently now on the develop branch. Thanks for your help!