wecodemore / wpstarter

Easily bootstrap whole site Composer packages for WordPress.
https://wecodemore.github.io/wpstarter/
MIT License
246 stars 35 forks source link

Install script only runs when package is installed as root #24

Closed janhenckens closed 8 years ago

janhenckens commented 8 years ago

When I set "prevent-overwrite" to "ask" and run composer install, the post-install-cmd script doesn't run automatically.

I can fix this by setting the command to WCM\\WPStarter\\Setup::run instead of the runAsRoot, then the script does run for me.

franz-josef-kaiser commented 8 years ago

@janhenckens Could you please elaborate? What do you mean by "does not run automatically"? Does it run at all? Does it prompt you to answer questions?

janhenckens commented 8 years ago

I'm not. I set the prevent-overwrite to ask, run composer install and it finishes without prompting me with the questions.

gmazzap commented 8 years ago

Hi @janhenckens, thanks for your interest in WP Starter.

I saw that the problem happen when using the package as root.

The problem is that WP Starter composer.json only set "post-install-cmd" and not "post-update-cmd".

It means that after modifying the composer.json and updating, the install script is not run (and you have to run it manually via composer run wpstarter). I'm going to fix it.

However, let me say that if you are going to use this repo to ship a website in production, I suggest to create your own composer.json and require WP Starter as a dependency. This way will be easier to update WP Starter if necessary.

That is the suggested way in documentation http://wecodemore.github.io/wpstarter/.

Thanks again for reporting the issue.

gmazzap commented 8 years ago

@janhenckens I released version v2.2.5 including the fix. Can you give it a try?

janhenckens commented 8 years ago

Tested and it's working now!