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

Async version somehow doesn't report failures with gulp #84

Open
chillum opened this issue Apr 7, 2019 · 6 comments
Open

Async version somehow doesn't report failures with gulp #84

chillum opened this issue Apr 7, 2019 · 6 comments
Labels
bug 💵 Funded on Issuehunt This issue has been funded on Issuehunt help wanted

Comments

@chillum
Copy link

chillum commented Apr 7, 2019

Issuehunt badges

Hi,

I have gulp 4.0.0, del 4.1.0 and gulpfile.js like:

gulp.task('clean', function() {
  return del('index.html');
});

if it cannot remove the file (like doesn't have the permissions), it just reports task as success and moves on.
but this code actually fails when it cannot remove the file:

gulp.task('clean', function(done) {
  del.sync('index.html');
  done();
});

is this a bug or intentional behaviour?

There is a $40.00 open bounty on this issue. Add more on Issuehunt.

@EricCornelson
Copy link

Just ran in to this today as well, except my clean task (using del) was hanging indefinitely. When I switched to sync it immediately reported a EPERM error because of a locked file.

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 2, 2019
@IssueHuntBot
Copy link

@IssueHunt has funded $40.00 to this issue.


@stroncium
Copy link

@chillum Please, tell your nodejs version too. Also, looking at error being EPERM I suppose you are running it on windows, if so then your windows version too.
Plus, I'd like to see what exact permissions configuration you have there.

(I've tried it on linux with various configurations and it always throws error both in sync and async versions when it doesn't have rights for me. For windows, I've tried it on my Windows10 game machine and it does seem to report errors too when it can't delete file.)

@chillum
Copy link
Author

chillum commented May 6, 2019

@stroncium hm, I'm pretty sure I ran into this behavior on Mac.
and to run into it I used chmod 000 index.html

but what's strange is now I cannot reproduce this as well.
the only thing that had changed here since is Node upgraded from 11.13.0 to 11.14.0.

upd: cannot reproduce on node 10.15.3 as well.

@stroncium
Copy link

@chillum I suppose on mac it should work the same way as on linux, so just to be sure, wasn't it a case when you didn't have write permissions on file, but had write permissions on directory this file is in, and deletion actually went through? (In such case you can't write to file but still can delete it.)

@sindresorhus Also, being able to delete write protected file feels like a bug to me actually. Never expected that that to pass through.

@chillum
Copy link
Author

chillum commented May 7, 2019

@stroncium well, from my shell history it seems like I tried two options:

  1. making directory unwritable (chmod 555 or chmod 000)
  2. making file unreadable (chmod 000)

it seemed to me that the it used to fail on both scenarios, but now I cannot reproduce it: both sync and async versions throw errors (or remove the unreadable file if it has permissions).

I'd ask @EricCornelson whether he experienced this on NodeJS 11.13.0, as I have no other clues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 💵 Funded on Issuehunt This issue has been funded on Issuehunt help wanted
Projects
None yet
Development

No branches or pull requests

5 participants