Skip to content

[Bug] cssDir parameter fails to accept valid file inputs #2

Description

@yoktav

Description:

The cssDir parameter, which is intended to specify the directory where CSS files are located, throws an error when a specific file is passed instead of a directory. The error occurs during the scan for unused CSS classes from Twig files.

Steps to Reproduce:

  1. Set the cssDir parameter to point to a specific file (e.g., ./path/to/css/file/main.css).
  2. Run the script to find unused CSS classes from Twig files.
  3. Observe the error:
Error: ENOTDIR: not a directory, scandir './path/to/css/file/main.css'

Expected Behavior:
The cssDir parameter should allow passing a file path or handle file-specific scenarios gracefully, without causing an error.

Actual Behavior:
The script throws an ENOTDIR error when a file is passed to the cssDir parameter, expecting a directory instead.

Environment:

  • Version: v1.0.0
  • OS: macOS
  • Node.js: v18.3.0

Error:

Error: ENOTDIR: not a directory, scandir './path/to/css/file/main.css'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions