Skip to content

Commit

Permalink
[CMS-864] Update install url in docs. (#85)
Browse files Browse the repository at this point in the history
* Update install url in docs.

* Update regex to be more URL specific.
  • Loading branch information
kporras07 authored Aug 29, 2022
1 parent 86e1be3 commit 8419c5d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Cli/UpdateTerminusDocsCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,20 @@ public function terminusUpdateDocs($options = [
file_put_contents($dir . '/source/data/terminusReleases.json', $releasesJson);
}

$installMdContents = file_get_contents($dir . '/source/content/terminus/install.md');
$replacement = '${1}' . $terminusRelease . '${3}';
$installMdContents = preg_replace('/(.*https:\/\/github\.com\/pantheon-systems\/terminus\/releases\/download\/)(\d+\.\d+\.\d+)(.*)/', $replacement, $installMdContents);
file_put_contents($dir . '/source/content/terminus/install.md', $installMdContents);


if (!$workingCopy->status()) {
$this->logger->info('Nothing to update.');
return;
}

$this->logger->info('Committing changes...');
$commitMessage = $options['commit-message'];
$workingCopy->add("$dir/source/data");
$workingCopy->add("$dir/source/data $dir/source/content");
$workingCopy->commit($commitMessage);

$dryRun = $options['dry-run'];
Expand Down

0 comments on commit 8419c5d

Please sign in to comment.