Comments (4)
Fixed on master, published as glob 3.1
from node-glob.
@isaacs This was an unexpected change for me as well. What's the deal?
from node-glob.
We're having to do something ghetto like this after the glob result to "normalize":
var cwd = process.cwd();
function fix (f) {
if (f[0] === '/') {
// Good
return f;
} else {
// `glob` stripped CWD...
return path.join(cwd, f);
}
}
result = result.map(fix);
from node-glob.
Yeah, it's a bug. Haven't had a chance to fix it yet.
The solution is to detect whether each pattern in the set is absolute or not, and only strip the cwd from each result if it was not an absolute pattern.
Also, weird though it may be, there were previous cases where {/foo,/foo}
would return the same thing more than once, so each match needs to be tied to a given glob in the set. That's the ultimate solution, though @TooTallNate's workaround is ok for the short-term.
from node-glob.
Related Issues (20)
- New version jackspeak break commonjs libs HOT 6
- Are there return value examples for versions 7.1.6 and 10 glob.sync HOT 4
- Recent bump of `jackspeak` dep should have been a major version bump HOT 8
- Patch update 10.3.6 -> 10.3.7 appears to have multiple breaking changes HOT 3
- Redundant `//?/` HOT 4
- Clarify nocase documentation (specifically when setting it to not match OS behavior) HOT 2
- ignore option is not working with relative path HOT 1
- Using path.join no results HOT 1
- CWE-772 on dependency inflight HOT 1
- Memory leak in inflight dependency HOT 4
- Using vulnerable package inflight HOT 1
- `glob.sync(...)` is not returning values when `".."` and `nocase: true` are used together. HOT 2
- results are in reverse alphabetical order HOT 5
- npm i glob
- npm i glob
- `follow: true` doesn't follow more that 1 symbolic link HOT 7
- Neutral JavaScript runtime support (Deno, Bun, etc)
- UNC not working in glob.sync HOT 4
- Glob behaves differently when handed a drive letter root as its directory (Windows) HOT 2
- Inconsistency when run in root drive path `/`, prefixes match with `/` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-glob.