コード例 #1
0
ファイル: PublishRelease.php プロジェクト: silverstripe/cow
 /**
  * @param OutputInterface $output
  * @param Library $parentLibrary
  * @param array $composerData
  */
 protected function updateComposerData(OutputInterface $output, Library $parentLibrary, array $composerData)
 {
     $parentName = $parentLibrary->getName();
     $this->log($output, "Rewriting composer.json for <info>{$parentName}</info>");
     // Write to filesystem
     $parentLibrary->setComposerData($composerData);
     // Commit to git
     $path = $parentLibrary->getComposerPath();
     $repo = $parentLibrary->getRepository();
     $repo->run("add", [$path]);
     $status = $repo->run("status");
     if (stripos($status, 'Changes to be committed:')) {
         $repo->run("commit", ["-m", "Update development dependencies"]);
     }
 }
コード例 #2
0
 /**
  * Remove composer alias from composer.json
  *
  * @param OutputInterface $output
  * @param Library $library
  */
 protected function removeComposerAlias(OutputInterface $output, Library $library)
 {
     // Check if there is any alias to remove
     $composerData = $library->getComposerData();
     if (empty($composerData['extra']['branch-alias'])) {
         return;
     }
     $this->log($output, "Removing branch alias from <info>" . $library->getName() . "</info>");
     unset($composerData['extra']['branch-alias']);
     // Write changes
     $path = $library->getComposerPath();
     $library->setComposerData($composerData);
     // Commit to git
     $repo = $library->getRepository();
     $repo->run("add", array($path));
     $status = $repo->run("status");
     if (stripos($status, 'Changes to be committed:')) {
         $repo->run("commit", array("-m", "Remove obsolete branch-alias"));
     }
 }