minify: latest slash path is been ignored

I started to get this problem in newer versions: (TBH, I still don’t undestand this error, but I guess it is related, so, I’ m showing it here)

$ minify  --match '\.(css|html|js|json)$' -sarp 'www/dev/' -o 'www/hml/'
ERROR: stat www/dev//www/dev/autoindex: no such file or directory

$ ls -l www/dev/autoindex
lrwxrwxrwx ... www/dev/autoindex -> lib/autoindex/js/NGINdeX.io/

But then, testing, if I remove the link from dev folder, and test it with files and directories only, I found this:

$ minify  --match '\.(css|html|js|json)$' -sarp 'www/dev/' -o 'www/hml/'

$ ls -l www/hml
total 1
drwxr-xr-x ... dev

And that is wrong! I wanted the dev folder content under hml folder and not dev folder under hml folder, because of that I used www/dev/ and not www/dev (notice the slash at the end).

It was working before, but the behavior changed somewhere in the way.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 25 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve added support for the --ext option! You can use it as:

$ minify -r -o out/ --ext.scss=text/css --ext.xjs=js src/

or

$ minify -r -o out/ --ext {scss:text/css xjs:js} src/