Skip to content

gulp.dest uses chmod on files #1012

Description

@hashworks

When I pipe my compiled css into gulp.dest(folder) it will fail with an error:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: EPERM, chmod 'css/screen.css'

This is because screen.css already exits and only gets overriden - however the user running gulp isn't the owner of the file.

This is a bug since according to the documentation chmod gets applied to new folders only:
options.mode - Octal permission string specifying mode for any folders that need to be created for output folder.

Code:

var gulp = require('gulp');
var sass = require('gulp-sass');
gulp.task('default', function() {
    gulp.src(sassUri + '**/*.{scss,sass}')
        .pipe(sass())
        .pipe(gulp.dest('css'));
});

PS: If this isn't a bug but a feature, how can I turn this off (or handle it properly)?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions