/**
  * Execute this command
  *
  * @inheritdoc
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln('<info>Started Installing!</info>');
     if (!$this->createUserAliasesDirectory()) {
         $output->writeln('<comment>Failure</comment> Aliases directory cannot be created. Installation failed.');
         return;
     }
     $this->mirror(PathHelper::getGeneralAliasesPath(), $this->getUserAliasesPath());
     $output->writeln(sprintf('<comment>%s</comment> has been installed.', 'General aliases'));
 }
 /**
  * Execute this command
  *
  * @inheritdoc
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $targetDirectory = $input->getArgument(self::TARGET_DIR_ARGUMENT);
     $exists = $this->vimConfigurationExists($targetDirectory);
     if ($exists) {
         $helper = $this->getHelper('question');
         $question = new ConfirmationQuestion(sprintf('<info>It appears, that vim configuration already exists in "%s" directory, should I override this configuration?</info> <comment>[Y/N=default]</comment>', $targetDirectory), false);
         if (!$helper->ask($input, $output, $question)) {
             $output->writeln(sprintf('Installation has been canceled! '));
             return;
         }
     }
     if (!$this->hasGit()) {
         $output->writeln('<comment>Git is not installed on Your OS. Installation failed!</comment>');
         return;
     } else {
         $output->writeln('<info>Started Installing!</info>');
         $this->mirror(PathHelper::getVimConfigPath(), $targetDirectory, $exists);
         $this->cloneVimPluginManager($targetDirectory);
     }
     $output->writeln(sprintf('<comment>%s</comment> installed into directory: <info>%s</info>', 'Vim configuration', $targetDirectory));
 }
示例#3
0
 /**
  * @test
  *
  * @covers  ::getBasePath
  * @covers  ::getTemplatesPath
  *
  * @return array
  */
 public function pathProvider()
 {
     return [[PathHelper::getBasePath(), 'Base Path'], [PathHelper::getTemplatesPath(), 'Template Path'], [PathHelper::getAliasesPath(), 'Aliases Path'], [PathHelper::getGeneralAliasesPath(), 'General Aliases Path']];
 }
示例#4
0
 /**
  * Creates a template on given target path
  *
  * @param string $templateName Template name
  * @param string $targetPath Target full path
  */
 protected function createTemplate($templateName, $targetPath)
 {
     $templatePath = PathHelper::getTemplatesPath() . '/' . $templateName;
     $this->mirror($templatePath, $targetPath);
 }