veged / borschik

Main repository moved to https://github.com/bem/borschik. Extendable builder for text-based file formats.
http://bem.info/articles/borschik/
94 stars 0 forks source link

Catch EEXIST errors on create directories #90

Open veged opened 11 years ago

veged commented 11 years ago

There is a code in lib/freeze.js:"

if (!FS.existsSync(_path)) {
    FS.mkdirSync(_path);
}

it's does't work properly because it's possible to catch state when FS.existsSync passed, but before FS.mkdirSync directory was created (especially when we run multiply threads with Borschik)

so I suggest add try/catch wrapper around FS.mkdirSync and ignore EEXIST exeption

doochik commented 11 years ago

Fixed in https://github.com/bem/borschik/commit/3734c69b1cfc562309dfd1dec731b383338d54f1