예제 #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $this->benchhelper->chStorage();
     $packages = \Config::get('workbench::packages');
     $packageNames = array_keys($packages);
     $destroy = false;
     if ($this->option('destroy')) {
         if ($this->confirm('Are you sure you want to remove all configured workbench packages? [yes|no]')) {
             $destroy = true;
         }
     }
     if ($this->option('fromBranch')) {
         $fromBranch = $this->option('fromBranch');
     } else {
         $fromBranch = 'master';
     }
     if ($newBranch = $this->option('createBranch')) {
         if ($this->confirm("Are you sure you want to switch to branch called {$newBranch}? [yes|no]")) {
             foreach ($packages as $name => $package) {
                 $this->info("PACKAGE: {$name}");
                 if (isset($package['git'])) {
                     $action = $this->benchhelper->branchGit($name, $package['git'], $newBranch, $fromBranch, $destroy);
                     if ($this->option('remote') && !empty($package['remotes']) && is_array($package['remotes'])) {
                         $this->info("remotes");
                         $this->benchhelper->fetchRemotes($name, $package['remotes']);
                     }
                     if ($this->option('merge')) {
                         $this->benchhelper->mergeRemote($this->option('merge'));
                     }
                     if (!$this->option('skipBower')) {
                         $this->benchhelper->bower($name);
                     }
                     if (!$this->option('skipComposer')) {
                         $this->benchhelper->composer($packageNames, $name, $action);
                     }
                     if (!$this->option('skipAssets')) {
                         $this->call('asset:publish', array('--bench' => $name));
                     }
                     if ($this->option('publishConfigs') || $action == 'install') {
                         // this should not be done all the time, first time only (install)
                         $this->call('config:publish', array('package' => $name, '--path' => 'workbench/' . $name . '/src/config'));
                     }
                 }
                 $this->info("============================");
             }
         }
     }
     $this->info("do not forget to register your providers!");
 }
예제 #2
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $this->benchhelper->chStorage();
     $packages = \Config::get('workbench::packages');
     foreach ($packages as $name => $package) {
         $this->info("PACKAGE: {$name}");
         if (isset($package['git'])) {
             if (!$this->option('skipAssets')) {
                 $this->call('asset:publish', array('--bench' => $name));
             }
             if ($this->option('publishConfigs')) {
                 // this should not be done all the time, first time only (install)
                 $this->call('config:publish', array('package' => $name, '--path' => 'workbench/' . $name . '/src/config'));
             }
         }
         $this->info("============================");
     }
     $this->info("publishing complete!");
 }
예제 #3
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     echo "This will publish assets & configs.\n";
     echo "Optionally publish views (-p).\n";
     if ($this->confirm('Do you wish to launch your configured packages from vendors directory?')) {
         $this->benchhelper->chStorage();
         $packages = \Config::get('workbench::packages');
         foreach ($packages as $name => $package) {
             echo "--- {$name} ---\n";
             $this->benchhelper->exec('php artisan config:publish ' . $name, false);
             echo "published configs\n";
             $this->benchhelper->exec('php artisan asset:publish ' . $name, false);
             echo "published assets\n";
             if ($this->option('publishViews')) {
                 $this->benchhelper->exec('php artisan view:publish ' . $name, false);
                 echo "published views\n";
             } else {
                 echo "skipping views (-p)\n";
             }
         }
     }
     $this->benchhelper->composer('artistan/workbench', 'update');
     $this->benchhelper->composer();
 }