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

Deletion failed in other directories #5

Closed
BlackHole1 opened this issue Oct 25, 2017 · 1 comment
Closed

Deletion failed in other directories #5

BlackHole1 opened this issue Oct 25, 2017 · 1 comment

Comments

@BlackHole1
Copy link

build/deletePm2Logs.js

let del = require('delete')

console.log('start delete logs')

del(['../logs/*.log'], {force: true}, function(err, deleted) {
  if (err) {
    console.log('fail')
  } else {
    console.log('success');
  }
});

command:
node build/deletePm2Logs.js

It prompt success, but it's not deleted

other info:
parameter delete is empty array

@BlackHole1
Copy link
Author

sorry, Got it. delete module's code be based on current node's path

in which case there's no problem.:

let del = require('delete')

console.log('start delete logs')

del(['./logs/*.log'], {force: true}, function(err, deleted) {
  if (err) {
    console.log('fail')
  } else {
    console.log('success');
  }
});

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

1 participant