mirror of
https://github.com/there4/markdown-resume.git
synced 2024-12-03 08:59:35 -05:00
Fix assetic incompatibility with PHAR by changing to streams library
This commit is contained in:
parent
3aef8ccd8c
commit
fa4e2f9e15
BIN
bin/md2resume
BIN
bin/md2resume
Binary file not shown.
@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
|
|||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Assetic\Asset\AssetCollection;
|
use Assetic\Asset\AssetCollection;
|
||||||
use Assetic\Asset\GlobAsset;
|
use Assetic\Asset\FileAsset;
|
||||||
use Assetic\Filter;
|
use Assetic\Filter;
|
||||||
use Michelf\MarkdownExtra;
|
use Michelf\MarkdownExtra;
|
||||||
use Michelf\SmartyPants;
|
use Michelf\SmartyPants;
|
||||||
@ -102,11 +102,21 @@ class HtmlCommand extends Command
|
|||||||
|
|
||||||
// We build these into a single string so that we can deploy this resume as a
|
// We build these into a single string so that we can deploy this resume as a
|
||||||
// single file.
|
// single file.
|
||||||
$cssAssetSelector = join(DIRECTORY_SEPARATOR, array($templatePath, '/css/*.css'));
|
$cssAssetPath = join(DIRECTORY_SEPARATOR, array($templatePath, '/css'));
|
||||||
|
$cssAssets = array();
|
||||||
|
|
||||||
|
// Our PHAR deployment can't handle the GlobAsset typically used here
|
||||||
|
foreach (new \DirectoryIterator($cssAssetPath) as $fileInfo) {
|
||||||
|
if ($fileInfo->isDot()) continue;
|
||||||
|
if (!$fileInfo->isFile()) continue;
|
||||||
|
array_push($cssAssets, new FileAsset($fileInfo->getPathname()));
|
||||||
|
}
|
||||||
|
|
||||||
$css = new AssetCollection(
|
$css = new AssetCollection(
|
||||||
array(new GlobAsset($cssAssetSelector)),
|
$cssAssets,
|
||||||
array(new Filter\LessphpFilter())
|
array(new Filter\LessphpFilter())
|
||||||
);
|
);
|
||||||
|
|
||||||
$style = $css->dump();
|
$style = $css->dump();
|
||||||
|
|
||||||
$templateContent = file_get_contents($templateIndexPath);
|
$templateContent = file_get_contents($templateIndexPath);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user