Skip to content

Conversation

aminya
Copy link
Contributor

@aminya aminya commented Sep 7, 2020

This uses del instead of rimraf. rimraf does not delete a directory when it is not empty. This should fix the error.

This is an error I get when I try to update threadjs.
andywer/threads.js#300

> puppet-run --plugin=mocha --bundle=./test/workers/:/workers/ --serve=./bundle/worker.js:/worker.js ./test/*.chromium*.ts

√ Bundling done.
Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\aminy\AppData\Local\Temp\puppet-run-cache4rxzKE'
    at Object.rmdirSync (fs.js:872:3)
    at rmkidsSync (C:\Users\aminy\Documents\GitHub\JavaScript\threads.js\node_modules\puppet-run\node_modules\rimraf\rimraf.js:364:25)
    at rmdirSync (C:\Users\aminy\Documents\GitHub\JavaScript\threads.js\node_modules\puppet-run\node_modules\rimraf\rimraf.js:342:7)
    at Function.rimrafSync [as sync] (C:\Users\aminy\Documents\GitHub\JavaScript\threads.js\node_modules\puppet-run\node_modules\rimraf\rimraf.js:312:9)
    at Object.clearTemporaryFileCache (C:\Users\aminy\Documents\GitHub\JavaScript\threads.js\node_modules\puppet-run\dist\temporary.js:35:22)
    at C:\Users\aminy\Documents\GitHub\JavaScript\threads.js\node_modules\puppet-run\dist\cli.js:213:37
    at step (C:\Users\aminy\Documents\GitHub\JavaScript\threads.js\node_modules\puppet-run\dist\cli.js:34:23)
    at Object.throw (C:\Users\aminy\Documents\GitHub\JavaScript\threads.js\node_modules\puppet-run\dist\cli.js:15:53)
    at rejected (C:\Users\aminy\Documents\GitHub\JavaScript\threads.js\node_modules\puppet-run\dist\cli.js:7:65)
    at runMicrotasks (<anonymous>) {
  errno: -4051,
  syscall: 'rmdir',
  code: 'ENOTEMPTY',
  path: 'C:\\Users\\aminy\\AppData\\Local\\Temp\\puppet-run-cache4rxzKE'

@aminya aminya marked this pull request as draft September 7, 2020 14:19
@aminya aminya marked this pull request as ready for review September 7, 2020 14:25
@andywer
Copy link
Owner

andywer commented Sep 7, 2020

Didn't know that. Thanks!

@andywer andywer merged commit 01404fb into andywer:master Sep 7, 2020
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.

2 participants