nizarmah / auto-minify

Minifies JS and CSS files in GitHub workflows.
GNU General Public License v3.0
48 stars 18 forks source link

Handling nested directories #1

Closed ekerstein closed 4 years ago

ekerstein commented 4 years ago

Thank you for making this! How do you recommend handling multiple directories? For example if I have:

js/a
js/b
js/c

Can I do something like directory: 'js/*'?

nizarmah commented 4 years ago

Hello! Thank you for using this Action ( :

The goal is to use directory: js/* in order to handle multiple directories. However, I need to make sure that it works, as sometimes I have small bugs in my code sadly.

Give me some time (about 10 mins), and I will update you on whether it works or not.

nizarmah commented 4 years ago

Alright, so according to this commit, it seems like the library does not support any * operator after the path.

This has become an issue now / bug report

However, I do understand how inefficient it would be to go through the following directories:

js/a
js/b
js/c

So, I have 3 solutions that I am thinking of, and they are: 1- Add a possibility for a * operator that would go through all the js directory and all the directories inside. 2- Add a recursive option recursive: true in order to target the directories inside js. 3- Add a sub-directories array that would target all the directories specified inside js.

#

I believe the most logical would be the first approach. Then the directory could be treated similarly to how the find command on linux would.

It shouldn't be difficult to apply that solution, it is just a matter of pipelining the output of one to the other. I'll keep you updated ( :

nizarmah commented 4 years ago

Alright, so fixed it finally :tada:

Click here to go to the test branch where I tested it out. It finally works.

So, all you have to do now is just specify:

directory: 'js/*'

Make sure to update your action to v1.4

This works for both CSS and JS.

And it works just like find would in Linux.

Thanks a lot for your issue by the way ( : And I'm glad that people are using the Action :D

Let me know if there's anything else you need, feel free to open a new issue : )