Browse Source

Switch Upgrader to external package

shalvah 3 years ago
parent
commit
d17cd655b4
3 changed files with 5 additions and 8 deletions
  1. 1 0
      composer.dingo.json
  2. 1 0
      composer.json
  3. 3 8
      src/Commands/Upgrade.php

+ 1 - 0
composer.dingo.json

@@ -32,6 +32,7 @@
         "nunomaduro/collision": "^3.0|^4.0|^5.0",
         "ramsey/uuid": "^3.8|^4.0",
         "shalvah/clara": "^3.0.2",
+        "shalvah/upgrader": "0.*",
         "spatie/data-transfer-object": "^2.6|^3.0",
         "symfony/var-exporter": "^4.0|^5.0",
         "symfony/yaml": "^4.0|^5.0"

+ 1 - 0
composer.json

@@ -31,6 +31,7 @@
     "nunomaduro/collision": "^3.0|^4.0|^5.0",
     "ramsey/uuid": "^3.8|^4.0",
     "shalvah/clara": "^3.0.2",
+    "shalvah/upgrader": "0.*",
     "spatie/data-transfer-object": "^2.6|^3.0",
     "symfony/var-exporter": "^4.0|^5.0",
     "symfony/yaml": "^4.0|^5.0"

+ 3 - 8
src/Commands/Upgrade.php

@@ -3,21 +3,16 @@
 namespace Knuckles\Scribe\Commands;
 
 use Illuminate\Console\Command;
-use Knuckles\Scribe\Tools\Upgrader;
+use Shalvah\Upgrader\Upgrader;
 
 class Upgrade extends Command
 {
-    protected $signature = "scribe:upgrade {version=v3} {--dry-run}";
+    protected $signature = "scribe:upgrade {--dry-run}";
 
     protected $description = '';
 
     public function handle(): void
     {
-        $toVersion = $this->argument('version');
-        if ($toVersion !== 'v3') {
-            return;
-        }
-
         $oldConfig = config('scribe');
         $upgrader = Upgrader::ofConfigFile('config/scribe.php', __DIR__ . '/../../config/scribe.php')
             ->dontTouch('routes')
@@ -47,7 +42,7 @@ class Upgrade extends Command
         }
 
         $this->newLine();
-        $this->info("✔ Upgraded your config to $toVersion. Your old config is backed up at config/scribe.php.bak.");
+        $this->info("✔ Upgraded your config to v3. Your old config is backed up at config/scribe.php.bak.");
         $this->info("Please review to catch any mistakes.");
         $this->warn("If you have any custom strategies or views, you should migrate those manually. See the migration guide at http://scribe.knuckles.wtf.");
         $this->info("Don't forget to check out the release announcement for new features!");