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
- cmd: fix input/output directory edge cases and platform-specific operators in paths, fixes #438 — committed to tdewolff/minify by tdewolff 3 years ago
- Fix trailing slashes for CLI, fixes #438; remove copied implementation of io/fs — committed to tdewolff/minify by tdewolff 10 months ago
- Fix bug in previous commit; fixes #438 — committed to tdewolff/minify by tdewolff 10 months ago
- Update docs, remove --mime in favor of --type, add mimetype for webmanifest extension, see #438 — committed to tdewolff/minify by tdewolff 9 months ago
- cmd: support --match/--include/--exclude with wildcards such as *.js or index.*, otherwise use regexp as before; the glob pattern will match the final part of the path, see #438 — committed to tdewolff/minify by tdewolff 9 months ago
- cmd: add .rss, .xhtml, and .webmanifest mimetypes, see #438 — committed to tdewolff/minify by tdewolff 9 months ago
- cmd: use tdewolff/argp for argument parsing; support --ext for mapping custom extensions, see #438 — committed to tdewolff/minify by tdewolff 9 months ago
I’ve added support for the
--extoption! You can use it as:or