Skip to content

Commit 950c4b9

Browse files
committedMay 25, 2019
Wrapped the mkdirSync with try/catch to prevent file already exists exception
1 parent 9f6efb7 commit 950c4b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎binstall.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ function untgz(url, path, options) {
4242
reject("Error decompressing " + url + " " + error);
4343
});
4444

45-
fs.mkdirSync(path);
45+
try {
46+
fs.mkdirSync(path);
47+
} catch (error) {
48+
if (error.code !== 'EEXIST') throw error;
49+
}
4650

4751
request
4852
.get(url, function(error, response) {

0 commit comments

Comments
 (0)
Please sign in to comment.