CHH / pipe

Put your assets into the pipe and smoke them.
MIT License
120 stars 9 forks source link

Bug with compression? #44

Closed thekar closed 11 years ago

thekar commented 11 years ago

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Error while compressing "./css/application.css": sh: : command not found ' in /Users/tk/Desktop/web/purpleleaves1_6/pipe/lib/Pipe/Compressor/BaseYuglifyCompressor.php:32 Stack trace: #0 /Users/tk/Desktop/web/purpleleaves1_6/pipe/lib/Pipe/Compressor/YuglifyCss.php(14): Pipe\Compressor\BaseYuglifyCompressor->compress('#dashboard_wrap...', 'css') #1 /Users/tk/Desktop/web/purpleleaves1_6/pipe/lib/Pipe/Context.php(76): Pipe\Compressor\YuglifyCss->render(Object(Pipe\Context)) #2 /Users/tk/Desktop/web/purpleleaves1_6/pipe/lib/Pipe/BundledAsset.php(18): Pipe\Context->evaluate('./css/applicati...', Array) #3 /Users/tk/Desktop/web/purpleleaves1_6/templates/purpleleaves/css-assets.php(29): Pipe\BundledAsset->getBody() #4 {main} thrown in /Users/tk/Desktop/web/purpleleaves1_6/pipe/lib/Pipe/Compressor/BaseYuglifyCompressor.php on line 32

my code: <?php require '../../pipe/vendor/autoload.php';

use Pipe\Environment;

$env = new Environment; $env->appendPath("./"); $env->appendPath("./css"); $env->appendPath("./css/tk");

$env->setJsCompressor('yuglify_js'); $env->setCssCompressor('yuglify_css');

application holds directive for several .css files. works fine without compression.

$assets[] = $env->find('application.css', ['bundled' => true]);

foreach($assets as $asset) { echo $asset->getBody();

$asset->write(array("dir" => './build/css', 'include_digest' => true, 'compress' => true));

}

CHH commented 11 years ago

Are you sure that the yuglify command is installed on your system and in the PATH?

You can install yuglify with npm -g install yuglify.

CHH commented 11 years ago

I've now added a better error message when the yuglify command was not found.

thekar commented 11 years ago

Yes i am that it is installed. I believe i narrowed down the problem, which is not your implementation, but the Symfony/Process. As far as i know it is using "sh yuglify", but this does not work in my terminal/server. What would work is "sh -c yuglfiy", though. I have no idea how to approach this. Keep on the good work. Thanks

thekar commented 11 years ago

It seems to have been a config problem with macos. On my webserver it works just fine. I did not find the problem and had to set up a vagrant box mirroring my web server.