Skip to content

Commit

Permalink
Merge branch 'release/v1.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
reliq committed Nov 8, 2017
2 parents a3159ca + a67f813 commit 4f242aa
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/Services/Publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,24 +154,26 @@ private function publishVersions($name, $dir, $source, &$callingCommand = null)

try {
$listTags->mustRun();
$tags = array_map('trim', preg_split("[\n\r]", $listTags->getOutput()));
$tags = array_map('trim', preg_split("/[\n\r]/", $listTags->getOutput()));
$result->messages = [];

// publish each tag
foreach ($tags as $tag) {
if (!$this->files->isDirectory("$masterDir/../$tag")) {
$cloneTag = new Process("git clone --branch $tag \"{$source}\" ../$tag", $masterDir);
$cloneTag->mustRun();
// publish assets
$product->publishAssets($tag);
$this->tell("Successfully published tag $tag.");
// increment
$versionsPublished++;
} else {
$message = "Version $tag already exists.";
$result->messages[] = $message;
Log::info($message, ['state' => $this, 'product' => $product]);
$this->tell($message);
if (!empty($tag)) {
if (!$this->files->isDirectory("$masterDir/../$tag")) {
$cloneTag = new Process("git clone --branch $tag \"{$source}\" ../$tag", $masterDir);
$cloneTag->mustRun();
// publish assets
$product->publishAssets($tag);
$this->tell("Successfully published tag $tag.");
// increment
$versionsPublished++;
} else {
$message = "Version $tag already exists.";
$result->messages[] = $message;
Log::info($message, ['state' => $this, 'product' => $product]);
$this->tell($message);
}
}
}
} catch (ProcessFailedException $e) {
Expand Down

0 comments on commit 4f242aa

Please sign in to comment.