You are here

public static function LibsassCompiler::getStatus in SCSS/Less Compiler 8

Returns status of compiler library.

Return value

string|bool TRUE if library installed or string with error message.

Overrides ScssCompilerPluginInterface::getStatus

1 call to LibsassCompiler::getStatus()
LibsassCompiler::init in src/Plugin/ScssCompiler/LibsassCompiler.php
Calls a code on plugin initialization.

File

src/Plugin/ScssCompiler/LibsassCompiler.php, line 102

Class

LibsassCompiler
Plugin implementation of the Libsass compiler.

Namespace

Drupal\scss_compiler\Plugin\ScssCompiler

Code

public static function getStatus() {
  if (!function_exists('proc_open')) {
    return t('@function disabled.', [
      '@function' => 'proc_open',
    ]);
  }

  // Checks if node-sass binary exists, run any cli commands will take to many
  // time.
  if (!file_exists(\Drupal::service('scss_compiler')
    ->getOption('node_modules_path') . '/node-sass/bin/node-sass')) {
    return t('Node-sass library not found');
  }
  return TRUE;
}