{"action":"created","issue":{"url":"https://api.github.com/repos/composer/composer/issues/5684","repository_url":"https://api.github.com/repos/composer/composer","labels_url":"https://api.github.com/repos/composer/composer/issues/5684/labels{/name}","comments_url":"https://api.github.com/repos/composer/composer/issues/5684/comments","events_url":"https://api.github.com/repos/composer/composer/issues/5684/events","html_url":"https://github.com/composer/composer/issues/5684","id":177418788,"number":5684,"title":"Run scripts only if the class is found","user":{"login":"theofidry","id":5175937,"avatar_url":"https://avatars.githubusercontent.com/u/5175937?v=3","gravatar_id":"","url":"https://api.github.com/users/theofidry","html_url":"https://github.com/theofidry","followers_url":"https://api.github.com/users/theofidry/followers","following_url":"https://api.github.com/users/theofidry/following{/other_user}","gists_url":"https://api.github.com/users/theofidry/gists{/gist_id}","starred_url":"https://api.github.com/users/theofidry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theofidry/subscriptions","organizations_url":"https://api.github.com/users/theofidry/orgs","repos_url":"https://api.github.com/users/theofidry/repos","events_url":"https://api.github.com/users/theofidry/events{/privacy}","received_events_url":"https://api.github.com/users/theofidry/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-16T12:55:44Z","updated_at":"2016-09-16T13:08:55Z","closed_at":null,"body":"My `composer.json`:\r\n\r\n```json\r\n{\r\n  \"require\": {\r\n    \"acme/lib1\": \"dev-master\"\r\n  },\r\n  \"require-dev\": {\r\n    \"acme/lib2\": \"dev-master\"\r\n  },\r\n  \"scripts\": {\r\n    \"post-install-cmd\": [\r\n      \"Acme\\\\lib1\\\\Dummy::postInstallScript\",\r\n      \"Acme\\\\lib2\\\\AnotherDummy::postInstallScript\"\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\nNow if I do a `composer install --no-dev`, it will fail because it won't find `Acme\\lib2\\AnotherDummy` which is a dev dependency. If I do `composer install --no-dev --no-script`, `Acme\\lib1\\Dummy::postInstallScript()` won't be called.\r\n\r\nIs there anyway to get around that natively in Composer or should I implement a thin wrapper to check the existence of the class to not run the script if it can't?"},"comment":{"url":"https://api.github.com/repos/composer/composer/issues/comments/247596113","html_url":"https://github.com/composer/composer/issues/5684#issuecomment-247596113","issue_url":"https://api.github.com/repos/composer/composer/issues/5684","id":247596113,"user":{"login":"alcohol","id":21414,"avatar_url":"https://avatars.githubusercontent.com/u/21414?v=3","gravatar_id":"","url":"https://api.github.com/users/alcohol","html_url":"https://github.com/alcohol","followers_url":"https://api.github.com/users/alcohol/followers","following_url":"https://api.github.com/users/alcohol/following{/other_user}","gists_url":"https://api.github.com/users/alcohol/gists{/gist_id}","starred_url":"https://api.github.com/users/alcohol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alcohol/subscriptions","organizations_url":"https://api.github.com/users/alcohol/orgs","repos_url":"https://api.github.com/users/alcohol/repos","events_url":"https://api.github.com/users/alcohol/events{/privacy}","received_events_url":"https://api.github.com/users/alcohol/received_events","type":"User","site_admin":false},"created_at":"2016-09-16T13:08:55Z","updated_at":"2016-09-16T13:08:55Z","body":"Since order is important, simply place the non-dev scripts before the dev ones. That way it will fail at the right point in time."}}
{"actor":{"display_login":"alcohol"}}