Skip to content

Commit

Permalink
Added package reference when a -dev version is installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
joachim-n committed Mar 15, 2019
1 parent 29186c8 commit 094604c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,25 @@ public function updateManifest(BaseEvent $event) {

$package_names = [];
foreach ($packages as $package) {
$package_versions[$package->getName()] = $package->getPrettyVersion();
$pretty_version = $package->getPrettyVersion();
$output_version = $pretty_version;

// If the package is using a dev version, append the git commit SHA so
// that we can see changes to the actual version used.
// (No idea why it's sometimes a dev- prefix and sometimes a -dev suffix,
// but check for both.)
if (substr($pretty_version, 0, 4) == 'dev-' || substr($pretty_version, -4) == '-dev') {
$reference = $package->getSourceReference();

// Fall back to the dist reference if the source reference is empty.
if (empty($reference)) {
$reference = $package->getDistReference();
}

$output_version .= ':' . $reference;
}

$package_versions[$package->getName()] = $output_version;
}

$yaml_data = [
Expand Down

0 comments on commit 094604c

Please sign in to comment.