jeremeamia / kohana-less

A Ko3 module for easy inclusion and use of LESS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check directories when compiling css

justus opened this issue · comments

Compiled css file is not saved if it has directories in it's filename.

EDIT: True if directory doesn't already exist, of course :)

Here's a quick fix:

Less.php (Line 29)

$sources = array();
foreach ($source_names as $source)
{           
    // Check if target includes directories
    $dirs = explode(DIRECTORY_SEPARATOR, $source);

    // If found, check if directories really exist. If not, create them.
    if(count(array_pop($dirs)))
    {
        $full_dir = rtrim($config->css_path, DIRECTORY_SEPARATOR.'/');

        foreach($dirs as $dir)
        {
            $full_dir .= DIRECTORY_SEPARATOR.$dir;                  

            if(!is_dir($full_dir))
            {
                mkdir($full_dir);
            }                   
        }
    }

    $sources[] = rtrim($config->less_path, DIRECTORY_SEPARATOR.'/').'/'.$source.'.less';
}

thanks. I'll look into this as soon as I can.