Skip to content

Conversation

albertmatyi
Copy link

The problem is that if the noFile flag is on, the file object will come with a null path thus breaking the logic of path.dirname which is not checked at all.

In this solution I provide a fallback

The problem is that if the `noFile` flag is on, the `file` object will come with a `null` path thus breaking the logic of `path.dirname` which is not checked at all.

In this solution I provide a fallback
@andidev
Copy link
Owner

andidev commented May 3, 2016

Sorry for being late, I'll try to review and release this as soon as I have time

@albertmatyi
Copy link
Author

No problem :) Thank you for taking the time.

Have a nice day!
m

@dshefchik
Copy link

@albertmatyi That is actually not the correct fix for this bug, the issue is here:
stream.end(new gutil.File({ path: options.dest | 'constants.js' }));

Notice the " | " operator? I can't imagine that's on purpose...

@andidev
Copy link
Owner

andidev commented May 29, 2016

Is this forked plugin really needed? Doesn't the original plugin support the noFile and deps: false feature today?

As I know the following

gulp.task('config', function () {
    ngConstant({
        dest: 'app.config.js',
        name: 'my.module.config',
        noFile: true,
        deps: false,
        constants: {ENV: 'dev!'}
    })
    // Writes app.config.js to dist/ folder
    .pipe(gulp.dest('dist'));
});

can be configured by:

gulp.task('config', function () {
    ngConstant({
        dest: 'app.config.js',
        name: 'my.module.config',
        constants: {ENV: 'dev!'}
    })
    // Writes app.config.js to dist/ folder
    .pipe(gulp.dest('dist'));
});

in the original version of gulp-ng-constant 1.1.0.

Or is there another reason for why you are using this forked plugin?

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

Successfully merging this pull request may close these issues.

3 participants