Skip to content

Problems with Includes #6

@killercup

Description

@killercup

Hi,

I just wanted to try this out and got some errors concerning missing files for includes.

Gulpfile:

gulp.task 'api_docs', ->
  gulp.src('api/*.raml')
  .pipe raml2html()
  .pipe gulp.dest('public/api')

RAML file:

schemas:
  - show: !include schemas-show.json
Error: /Users/pascal/Projekte/EF/public/api/ef-api.raml:27:11: Parse error while reading schemas-show.json: cannot read schemas-show.json (Error: ENOENT, open 'schemas-show.json')
  at /Users/pascal/Projekte/EF/node_modules/gulp-raml2html/index.js:32:16
  at process._tickCallback (node.js:419:13)

From what I can tell, this is because here the first action of the plugin is pushing the file object back into the stream. But when convertFile is later called, the file's path has been changed by gulp.dest(cf. this).

Long story short, I moved the this.push(file); line to the end of the function and it seems to work.

(Maybe I'll send a pull request later, I just wanted to write this down before I forget.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions