sync-exec
sync-exec copied to clipboard
Use mkdirSync in create-pipes
Replace mkdir with mkdirSync in create-pipes, so error thrown (e.g. on directory existed) would be properly caught.
Currently on directory collision, the asynchronous mkdir's error would not be caught and sync-exec would erroneously assumed the directory to exist, which could result in various error such as hanging.
I know with execSync inherently in Node 0.12 the wise thing to do is probably to move onto that. But for various reasons I'm currently stuck with Node 0.10 and sync-exec is what I'm using to polyfill execSync.
@gvarsanyi would you help review this PR?