Parcourir la source

admin:publish 代码优化

jqh il y a 4 ans
Parent
commit
fe38fd0b7e
1 fichiers modifiés avec 9 ajouts et 1 suppressions
  1. 9 1
      src/Console/PublishCommand.php

+ 9 - 1
src/Console/PublishCommand.php

@@ -53,8 +53,16 @@ class PublishCommand extends Command
             $tags[] = 'dcat-admin-config';
         }
 
+        if (! $tags) {
+            $tags[] = null;
+        }
+
         foreach ($tags as $tag) {
-            $this->call('vendor:publish', $options + ['--tag' => $tag]);
+            if ($tag) {
+                $options['--tag'] = $tag;
+            }
+
+            $this->call('vendor:publish', $options);
         }
 
         $this->call('view:clear');