html-minifier icon indicating copy to clipboard operation
html-minifier copied to clipboard

html-minifier Creates a New Directory When One With The Specified Name Already Exists

Open R4356th opened this issue 4 years ago • 1 comments

If the specified output-dir already exists when using the CLI, it creates a new directory with that name and puts minified versions of the input (making sure to update the copy in the already existing directory as well). While a straightforward workaround is to just ignore the duplicate directory in VCS, it is not ideal and not even an option for those who do not use any VCS. See also #1062).

R4356th avatar Oct 12 '21 13:10 R4356th

Can confirm this behaviour. It will reclusively create folders in folders.

Windows 11 Using version V4.0.0

Command used.

html-minifier --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true --input-dir source/path/to/pages --output-dir source/path/to/pages/mini --file-ext html 

This results in a directory structure:

-pages
--mini
---output files

On the next run

-pages
--mini
---mini
----output files

Each run will create a mini sub directory in the previous mini sub directory.

Devilbinder avatar Sep 05 '23 10:09 Devilbinder