From d2817f48a1146b469d544ee78015251551d358c3 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Sun, 25 Feb 2018 21:40:17 -0800 Subject: [PATCH] Use sync fs.mkdir Summary: This ensures that errors are actually noticed in case it is not possible to create the directory. This will also throw an error when used with the upcoming Node.js 10.x because there is no callback. Refs: https://github.com/nodejs/node/pull/18668 [CLI][MINOR][local-cli/library/library.js] - Use sync fs.mkdir for error handling Closes https://github.com/facebook/react-native/pull/18084 Differential Revision: D7083122 Pulled By: shergin fbshipit-source-id: a13b64e57860e1ab2c15e0c008211dc0dca3b2d2 --- local-cli/library/library.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-cli/library/library.js b/local-cli/library/library.js index e8246ff7a106fd..14afd6a4059b7f 100644 --- a/local-cli/library/library.js +++ b/local-cli/library/library.js @@ -29,7 +29,7 @@ function library(argv, config, args) { const source = path.resolve('node_modules', 'react-native', 'Libraries', 'Sample'); if (!fs.existsSync(libraries)) { - fs.mkdir(libraries); + fs.mkdirSync(libraries); } if (fs.existsSync(libraryDest)) {