Closed rootical closed 9 years ago
No, dirname is not always .
. Check the readme:
dirname
is the relative path from the base directory set bygulp.src
to the filename.
gulp.src(['client/README.md'])
sets base path to client/
.
var gulp = require('gulp');
gulp.src(['client/README.md'])
.on('data', function(file) {
console.log(file.base); // /User/path/to/project/client/
});
I want to know the name of the directory. Why is it always equal to
'.'
? Any way to get it correctly?