src/Robo/Commands/Blt/AliasCommand.php
protected function createNewAlias() {
    $this->say("Installing <comment>blt</comment> alias...");
    $config_file = $this->getInspector()->getCliConfigFile();
    if (is_null($config_file)) {
      $this->logger->error("Could not install blt alias. No profile found. Tried ~/.zshrc, ~/.bashrc, ~/.bash_profile, ~/.profile, and ~/.functions.");
    }
    else {
      $canonical_alias = file_get_contents($this->getConfigValue('blt.root') . '/scripts/blt/alias');
      $result = $this->taskWriteToFile($config_file)
        ->text($canonical_alias)
        ->append(TRUE)
        ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
        ->run();

      if (!$result->wasSuccessful()) {
        throw new BltException("Unable to install BLT alias.");
      }

      $this->say("<info>Added alias for blt to $config_file.</info>");
      $this->say("You may now use the <comment>blt</comment> command from anywhere within a BLT-generated repository.");
      $this->say("Restart your terminal session or run <comment>source $config_file</comment> to use the new command.");
    }
  }
protected function createNewAlias() {
    $this->say("Installing <comment>blt</comment> alias...");
    $config_file = $this->getInspector()->getCliConfigFile();
    if (is_null($config_file)) {
      $this->logger->error("Could not install blt alias. No profile found. Tried ~/.zshrc, ~/.bashrc, ~/.bash_profile, ~/.profile, and ~/.functions.");
    }
    else {
      $canonical_alias = file_get_contents($this->getConfigValue('blt.root') . '/scripts/blt/alias');
      $result = $this->taskWriteToFile($config_file)
        ->text($canonical_alias)
        ->append(TRUE)
        ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
        ->run();

      if (!$result->wasSuccessful()) {
        throw new BltException("Unable to install BLT alias.");
      }

      $this->say("<info>Added alias for blt to $config_file.</info>");
      $this->say("You may now use the <comment>blt</comment> command from anywhere within a BLT-generated repository.");
      $this->say("Restart your terminal session or run <comment>source $config_file</comment> to use the new command.");
    }
  }
protected function createNewAlias ( ) { $ this -> say ( "Installing <comment>blt</comment> alias..." ) ; $ config_file = $ this -> getInspector ( ) -> getCliConfigFile ( ) ; if ( is_null ( $ config_file ) ) { $ this -> logger -> error ( "Could not install blt alias. No profile found. Tried ~/.zshrc, ~/.bashrc, ~/.bash_profile, ~/.profile, and ~/.functions." ) ; } else { $ canonical_alias = file_get_contents ( $ this -> getConfigValue ( 'blt.root' ) . '/scripts/blt/alias' ) ; $ result = $ this -> taskWriteToFile ( $ config_file ) -> text ( $ canonical_alias ) -> append ( TRUE ) -> setVerbosityThreshold ( VerbosityThresholdInterface :: VERBOSITY_VERBOSE ) -> run ( ) ; if ( ! $ result -> wasSuccessful ( ) ) { throw new BltException ( "Unable to install BLT alias." ) ; } $ this -> say ( "<info>Added alias for blt to $config_file.</info>" ) ; $ this -> say ( "You may now use the <comment>blt</comment> command from anywhere within a BLT-generated repository." ) ; $ this -> say ( "Restart your terminal session or run <comment>source $config_file</comment> to use the new command." ) ; } }
Creates a new BLT alias in appropriate CLI config file.
Creates a new BLT alias in appropriate CLI config file .