Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path concatenation example doesn't work #75

Closed
olabaloo opened this issue Oct 11, 2016 · 2 comments
Closed

Path concatenation example doesn't work #75

olabaloo opened this issue Oct 11, 2016 · 2 comments

Comments

@olabaloo
Copy link

The example provided to concatenate relative paths, e.g. src/svg/one/two/three/circle.svg to one-two-three-circle, doesn't work.

When I print path.sep to the console, gulp says it is undefined.

Example:

var gulp = require('gulp');
var rename = require('gulp-rename');
var svgstore = require('gulp-svgstore');

gulp.task('default', function () {
    return gulp
        .src('src/svg/**/*.svg', { base: 'src/svg' })
        .pipe(rename(function (path) {
            console.log(path.sep);                   // undefined
            var name = path.dirname.split(path.sep);
            name.push(path.basename);
            path.basename = name.join('-');
        }))
        .pipe(svgstore())
        .pipe(gulp.dest('dest'));
});
@w0rm
Copy link
Owner

w0rm commented Oct 23, 2016

Hi! Sorry for the late reply, yeah, I confused a path function argument and a path module that has path.sep

@w0rm
Copy link
Owner

w0rm commented Oct 23, 2016

I updated the Readme.

@w0rm w0rm closed this as completed Oct 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants