nizarmah / auto-minify

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

Fix: Create Output Directories if Don't Exist #9

Closed nizarmah closed 4 years ago

nizarmah commented 4 years ago

This pull request resolves the issue #8. This testing branch for this issue can be found on auto-minify-test/issues#8.

The successful GitHub Action can be found here.

Now, when the output directory is specified, it is created if it doesn't exist. In addition, if the directory is nested (eg. js/*), all the sub-directories in the js directory are then created in the output directory.

For example, consider the following

directory: 'js/*'
output: 'production/js'

if $output doesn't exist:
    create $output directory

go through directory:
    for example, we reach '$directory/something'
    if '$output/something' doesn't exist:
        create '$output/something' directory