SCSS watcher execute recursive scan of folder, only if shell_exec function not exists

Created on 3 June 2020, over 4 years ago
Updated 17 April 2024, 7 months ago

Looking at code in src/Services/ScssCompiler.php:

      if (function_exists('shell_exec')) {
        // Quick way to find more recent changed date in a directory.
        $last_modification_date = strtotime(shell_exec("ls {$path_data['directory_path']}/{$this->settings->get('scss_directory')} -Artlan --time-style=+\"%Y-%m-%dT%H:%M:%S%z\" | tail -n 1 | awk -F ' ' '{print \$6}'"));
      }
      else {
        $last_modification_date = scss_recursively_get_latest_modification_date("{$path_data['directory_path']}/{$this->settings->get('scss_directory')}");
      }

- recursive scan done only when function_exists('shell_exec') returns false, because ls command miss -R argument.

Maybe this better for performance, because users always can manually fill only needed folders to scan in SCSS settings, instead of always do recursive scan, that works much slower than scan one directory. So best solution is add checkbox "Execute recursive scan" in settings, with description "Works many times slower, than non-recursive scan".

Anyway, will be good to make both methods work in same way.

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡²Armenia murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States tbcs

    Removing shell_exec version in most recent version as unlikely to seriously encounter a performance problem when configured correctly

Production build 0.71.5 2024