wcm-io-frontend / aem-clientlib-generator

Creates configuration files for AEM ClientLibs and synchronizes assets.
Apache License 2.0
62 stars 32 forks source link

Create directories recursively #21

Closed samuelmeuli closed 5 years ago

samuelmeuli commented 5 years ago

With the following config:

module.exports = {
  // ...
  libs: {
    // ...
    assets: {
      js: ['./dist/**/*.js'],
      css: ['./dist/**/*.css'],
      resources: {
        cwd: './dist/',
        flatten: false,
        files: ['**/!(*.css|*.html|*.js|*.map)']
      }
    }
  }
};

and the following file structure:

dist/
  images/
    test.png
  test.css
  test.html
  test.js
  test.js.map

I receive the error

(node:22760) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, mkdir '../ui.apps/src/main/content/jcr_root/apps/project-name/clientlibs/project-name/resources/images'
(node:22760) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:22760) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Creating the clientlib directories recursively should resolve this problem.

stefanseifert commented 5 years ago

thanks for the contribution! we currently have vacation time, we will look into in in 1-2 weeks.

ifahrentholz commented 5 years ago

Tested with adjusted clientlib.config.js, everything works fine.

Thanks for your contribution :)