Esempio n. 1
0
 private function getRealFolder($appFolder, $fileType, IOStream $io)
 {
     $return = ['folder' => $appFolder . DIRECTORY_SEPARATOR . ucfirst($fileType) . 's', 'namespace' => "App\\" . ucfirst($fileType) . 's'];
     if (!is_dir($appFolder)) {
         $return['folder'] = $io->ask("App folder missing! Please Specify the Folder to create the file in:");
         if (!is_dir($appFolder)) {
             throw new \InvalidArgumentException("Directory {$appFolder} doesn't exist.");
         }
         $return['namespace'] = $io->ask("Please provide namespace for given folder");
     }
     return $return;
 }
Esempio n. 2
0
 private function bowerInstall()
 {
     if (!$this->checkIsInstalled('npm')) {
         if ($this->checkIsInstalled('brew')) {
             $this->io->writeln('Installing Node and npm:', 'green');
             system('brew install node');
         } else {
             $this->io->showErr('Node/npm not installed please install Node/npm, and then install bower (OR re-run this command)');
         }
         return;
     }
     if (!$this->checkIsInstalled('bower')) {
         $this->io->writeln('Installing bower:', 'green');
         system('npm install -g bower');
     }
     if (file_exists($this->application()->basePath() . '/bower.json')) {
         $this->io->writeln('Running bower:', 'green');
         system('bower install');
     } else {
         $value = $this->io->ask('Would you like to initialize bower?', 'yes', ['yes', 'no']);
         if ($value === 'yes') {
             system('bower init');
         }
     }
 }