Skip to content

CWD or './' outputs to wrong path. #916

@daniel-chapman-eqtr

Description

@daniel-chapman-eqtr

Version

0.21.0
0.20.0

Description

The project (gulpfile) is currently located at D:\Webs\projectname.website\src\ProjectName.Frontend.

Expected behaviour

  • Generated HTML files are output to D:\Webs\projectname.website\src\ProjectName.Frontend

Actual behaviour.

  • Files are output to D:\Webs

Steps to reproduce the problem.

  • Update to ^0.20.0
  • Set destination to .pipe(app.dest('./'))

Changing .pipe(app.dest('./')) to .pipe(gulp.dest('./')) seems to fix the problem, but i'm worried this is wrong when using assemble.

assemblefile.js

module.exports = function(gulp, $) {
  var isProduction = !!($.util.env.prod);

  var app = $.assemble();

  var minOptions = {
    collapseWhitespace: true,
    removeComments: true
  };

  gulp.task('assemble', function() {
    $.util.log($.util.colors.yellow('-- starting gulp assemble --'));

    app.layouts('src/html/layouts/**/*.hbs');
    app.partials('src/html/components/**/*.hbs');
    app.pages('src/html/pages/**/*.hbs');

    return app
      .toStream('pages')

      .pipe($.debug({
        title: 'assemble task:'
      }))

      .pipe(app.renderFile({
        'flatten': true
      }))
      .on('error', console.log)

      .pipe($.rename({
        extname: '.html'
      }))

      .pipe($.flatten())

      .pipe($.if(isProduction, $.htmlmin(minOptions), $.jsbeautifier()))

      // Problem line
      .pipe(app.dest('./'));
  });
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions