You are here

public function AcsfExtraCommands::versionGet in Acquia Cloud Site Factory Connector 8.2

Fetches the version of the acsf moduleset.

@command acsf-version-get @bootstrap root

Parameters

string $path: The path to the acsf moduleset.

File

src/Commands/AcsfExtraCommands.php, line 162

Class

AcsfExtraCommands
Provides drush commands for site related operations.

Namespace

Drush\Commands

Code

public function versionGet($path) {
  if (empty($path)) {
    $path = __DIR__;
  }
  $version = '0.0';
  $acsf_file_path = rtrim($path, '/') . '/acsf.info.yml';
  if (file_exists($acsf_file_path)) {
    $info_parser = new InfoParser();
    $info = $info_parser
      ->parse($acsf_file_path);
    $version = isset($info['acsf_version']) ? $info['acsf_version'] : '0.1';
  }
  $this
    ->output()
    ->writeln($version);
}