question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Base for gulp.src is empty if working directory has braces

See original GitHub issue

Relative gulp version: 4

Create any directory with brackets i.e “gulp (brackets)

  • create readme.md file
  • create simple gulpfile
const gulp = require('gulp');

gulp.task('default', function () {
  return gulp.src('readme.md')
    .pipe(gulp.dest('dist'));
})
  • run gulp

Actual result: In directory dest we can see readme.md inside “gulp (brackets)” directory

Expected result: In directory dest we can see readme.md file

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
lukaskostialcommented, Aug 23, 2016

It seems that it is caused by isGlob and globParent implementation where isGlob evaluates such folder name as glob…

// From is-glob
module.exports = function isGlob(str) {
  return typeof str === 'string'
    && (/[*!?{}(|)[\]]/.test(str)
     || isExtglob(str));
};

// From glob-parent
module.exports = function globParent(str) {
    str += 'a'; // preserves full path in case of trailing path separator
    do {str = path.dirname(str)} while (isglob(str));
    return str;
};

// From glob-stream :
var basePath = opt.base || globParent(ourGlob) + path.sep;
0reactions
phatedcommented, Aug 23, 2016

Thanks to the debugging by @lukaskostial / @heikki / @stevelacy and great work by @doowb this has been fixed in v5.3.3 of glob-stream

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gulp src returns empty file - Stack Overflow
When files are saved debug is checking the gulp.src output and most of the time it shows files with proper content but from...
Read more >
Gulp for Beginners | CSS-Tricks
Gulp is a tool that helps you out with several tasks when it comes to web development. It's often used to do front...
Read more >
Webpack or Browserify & Gulp: Which Is Better? - Toptal
Finally, we have gulp.watch , which watches a glob file pattern for changes, and when a change is detected, runs a series of...
Read more >
Rebecca Rumble - Page 4 of 5 - Programmer, Web Developer and ...
Creates a file called theme.scss in the sass directory. $ npm install gulp --save-dev. Install Gulp to the directory. This will update your...
Read more >
CoffeeScript
To install, first make sure you have a working copy of the latest stable ... Compile a directory tree of .coffee files in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found