"sync" method fails when no directory found #9

Closed
outaTiME opened this Issue Nov 23, 2011 · 0 comments

Comments

Projects
None yet
2 participants

Hi, Issacs ...

Yup .. like the title says ...

the sync method throw errors when no directory found ... but async method works fine ... take a look ...

usage:

rimraf.sync('build'); // no directory exists

out:

Error: ENOENT, No such file or directory 'build'
    at Object.lstatSync (fs.js:397:18)
    at Function.rimrafSync [as sync] (/Users/outaTiME/Development/projects/node_modules/rimraf/rimraf.js:134:23)
    at [object Object].action (/Users/outaTiME/Development/projects/skycop/skyweb-mvc/Jakefile:33:12)
    at [object Object].runNextTask (/opt/node/lib/node_modules/jake/lib/jake.js:351:27)
    at [object Object].runTask (/opt/node/lib/node_modules/jake/lib/jake.js:196:10)
    at Object.<anonymous> (/opt/node/lib/node_modules/jake/bin/cli.js:73:10)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)

otherwise ... the non sync method works fine ...

usage:

rimraf('build', function() {
  console.log('coool!');
});

my simple workaround was ... surround sync method with "exists" check ^^

thks !

isaacs closed this in 481c6b7 Dec 3, 2011

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