Updating generator for multiple files.
This commit is contained in:
parent
996225a9f4
commit
9d55ea8034
@ -11,6 +11,8 @@
|
|||||||
<delete dir="${basedir}/bootstrap"/>
|
<delete dir="${basedir}/bootstrap"/>
|
||||||
<delete dir="${basedir}/screenshots"/>
|
<delete dir="${basedir}/screenshots"/>
|
||||||
<delete dir="${basedir}/sublimeui"/>
|
<delete dir="${basedir}/sublimeui"/>
|
||||||
|
<delete dir="${basedir}/xcode"/>
|
||||||
|
<delete dir="${basedir}/highlightjs"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- Generate themes. -->
|
<!-- Generate themes. -->
|
||||||
|
@ -245,7 +245,8 @@ class Processor
|
|||||||
$path[] = $pattern->get('directory');
|
$path[] = $pattern->get('directory');
|
||||||
$path[] = $theme->get('theme.dir');
|
$path[] = $theme->get('theme.dir');
|
||||||
$path[] = $template->get('directory');
|
$path[] = $template->get('directory');
|
||||||
$path[] = $theme->get('theme.slug').$template->get('extension');
|
$name = $this->buildFileName($template->get('name'), $theme);
|
||||||
|
$path[] = $name.$template->get('extension');
|
||||||
|
|
||||||
// Concatonate paths with a slash.
|
// Concatonate paths with a slash.
|
||||||
$path = implode('/', $path);
|
$path = implode('/', $path);
|
||||||
@ -253,4 +254,27 @@ class Processor
|
|||||||
// Trim extra slashes, just for fun.
|
// Trim extra slashes, just for fun.
|
||||||
return preg_replace('/\/+/', '/', $path);
|
return preg_replace('/\/+/', '/', $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace theme name placeholders.
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
* @param Raincolor\Containers\Theme $theme
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function buildFileName($name, $theme)
|
||||||
|
{
|
||||||
|
if ($name == null) {
|
||||||
|
return $theme->get('theme.slug');
|
||||||
|
}
|
||||||
|
preg_match('/%(.+)%/i', $name, $matches);
|
||||||
|
foreach ($matches as $match) {
|
||||||
|
if (strpos($match, '%') !== false) {
|
||||||
|
$key = trim($match, '%');
|
||||||
|
$value = $theme->get($key);
|
||||||
|
$name = str_replace($match, $value, $name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user