#270 Removing a provider breaks Acorn until removing the packages cache #295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #270
tested on radicle
needs more testing in other contexts
did some digging and laravels default method is not invoking a new Process of the command via cli. Its removing the cache files in the same instance.
https://github.com/laravel/framework/blob/e217dca49e20cd2840970f8d307c8392012bc5be/src/Illuminate/Foundation/ComposerScripts.php#L48-L69
While acorn is initiating new Process of wp acorn cli command. It fails returning exit code 1. Since the Provider may have been removed when executing.
acorn/src/Roots/Acorn/ComposerScripts.php
Line 21 in b020038
acorn/src/Roots/Acorn/Console/Console.php
Lines 9 to 17 in b020038
acorn/src/Roots/Acorn/Console/Console.php
Lines 99 to 110 in b020038
Possible solution.
Reuse laravels method and make sure
getCachedConfigPath() resolves to
{projectpath}/storage/framework/cache/config.php
getCachedServicesPath() resolves to
{projectpath}/storage/framework/cache/services.php
getCachedPackagesPath() resolves to
{projectPath}/storage/framework/cache/packages.php
instead of
{projectpath}/bootstrap/cache/config.php
{projectpath}/bootstrap/cache/services.php
{projectPath}/bootstrap/cache/packages.php