Skip to content

Commit

Permalink
revert and and instead require the dev version
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Sep 26, 2024
1 parent f719d42 commit 017aced
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions src/Console/Commands/MakeAddon.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ protected function addRepositoryPath()

$this->files->put(base_path('composer.json'), $json);

$this->components->info("Repository added to your app's composer.json file.");
$this->components->info("Repository added to your app's composer.json.");
$this->components->bulletList([
'This allows Composer to reference your addon locally during development.',
'When you publish your package, you should remove this from your composer.json file.',
Expand All @@ -246,31 +246,6 @@ protected function addRepositoryPath()
return $this;
}

/**
* Ensures the `minimum-stability` setting is set to `dev` in the app's composer.json file,
* so we can install the addon successfully.
*
* @return $this
*/
protected function ensureMinimumStabilityIsDev()
{
$decoded = json_decode($this->files->get(base_path('composer.json')), true);

if (isset($decoded['minimum-stability']) && $decoded['minimum-stability'] === 'dev') {
return;
}

$decoded['minimum-stability'] = 'dev';

$json = json_encode($decoded, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);

$this->files->put(base_path('composer.json'), $json);

$this->components->info("Changed `minimum-stability` to `dev` in your app's composer.json file.");

return $this;
}

/**
* Install addon.
*
Expand All @@ -279,12 +254,11 @@ protected function ensureMinimumStabilityIsDev()
protected function installAddon()
{
$this->addRepositoryPath();
$this->ensureMinimumStabilityIsDev();

spin(
function () {
try {
Composer::withoutQueue()->throwOnFailure()->require($this->package);
Composer::withoutQueue()->throwOnFailure()->require($this->package, '*@dev');
} catch (ProcessException $exception) {
$this->line($exception->getMessage());
throw new \Exception('An error was encountered while installing your addon.');
Expand Down

0 comments on commit 017aced

Please sign in to comment.