Closed azweb76 closed 10 years ago
Wouldn't something like base: process.cwd()
make more sense?
That is what I started, however the code uses cwd to make unrelative. I can change to base if you'd prefer.
Since the code defaults the common path to cwd, I felt this would make sense.
Will look at this more when I get to a PC tonight
Sweet. Thanks for being so prompt.
Also noticed that if I add "/mydir//test/", the base is set to /mydir/test/. I think the logic for detecting the base needs more thought. Should probably stop the flatten2d at the first non-string.
I can change if you'd like.
@azweb76 it should stop it at the first non-string. i'm always open to PRs that add more tests (failing or passing)
@azweb76 the glob basePath issue is fixed as of glob2base 0.0.3
By setting cwdbase: true, all files returned from glob will have a relative path being relative to the cwd. This is useful if you want perform operations on multiple directories relative to the cwd and not relative to the lowest glob expression.
Example: gulp.src(["lib/", "bin/"], { cwd: process.cwd, cwdbase: true }).pipe(gulp.dest("/mydest/"));
This will result in /mydest/lib/ and /mydest/bin/ compared to /mydest/