Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'develop' of git://github.com/subtleGradient/packager

  • Loading branch information...
commit af134040a99e3d2284fc030d45bf6c2e7c01b050 2 parents 71c7924 + b00cbe4
@kamicane authored
Showing with 4 additions and 9 deletions.
  1. +4 −9 packager.php
View
13 packager.php
@@ -69,14 +69,9 @@ private function parse_manifest($path){
$descriptor = array();
// get contents of first comment
- preg_match('/\s*\/\*\s*(.*?)\s*\*\//s', $source, $matches);
+ preg_match('/\/\*\s*^---(.*?)^\.\.\.\s*\*\//ms', $source, $matches);
- if (!empty($matches)){
- // get contents of YAML front matter
- preg_match('/^-{3}\s*$(.*?)^(?:-{3}|\.{3})\s*$/ms', $matches[1], $matches);
-
- if (!empty($matches)) $descriptor = YAML::decode($matches[1]);
- }
+ if (!empty($matches)) $descriptor = YAML::decode($matches[0]);
// populate / convert to array requires and provides
$requires = (array)(!empty($descriptor['requires']) ? $descriptor['requires'] : array());
@@ -125,9 +120,9 @@ private function replace_build($package_path, $file){
$ref = @file_get_contents($package_path . '.git/HEAD');
if (empty($ref)) return $file;
- preg_match("@ref: ([\w\.-/]+)@", $ref, $matches);
+ preg_match("@ref: ([\w\./-]+)@", $ref, $matches);
$ref = file_get_contents($package_path . ".git/" . $matches[1]);
- preg_match("@([\w\.-/]+)@", $ref, $matches);
+ preg_match("@([\w\./-]+)@", $ref, $matches);
return str_replace("%build%", $matches[1], $file);
}
Please sign in to comment.
Something went wrong with that request. Please try again.