Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Problems when using non-glob paths #135

Closed

Description

@heyimalex

The issue is here.

You're using glob-parent to get the base if one isn't explicitly set, but glob-parent doesn't work properly on non-glob paths.

var globParent = require('glob-parent');
globParent('some/path.html');
// 'some/path.html'

So that makes opts.base equal to the actual filename, which makes vinyl.relative an empty string. Especially bad since vinyl-fs uses relative in dest, so the file will be written to whatever string was given to dest.

Noticed this when using 4.1.0 and logging didn't display anything for the matched filename.

Temporary fix: explicitly provide base for any non-glob paths.

Activity

  1. floatdrop commented on Feb 8, 2015

    @floatdrop
    Owner

    @heyimalex Nice catch! Fixed in 4.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions