From a60e6fee87e1822bfebfc6afc31c93c4d29a4f98 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Sat, 14 Mar 2020 03:58:30 -0700 Subject: [PATCH] Fix static path calculation Summary: Fixed a booboo where static path was calculated incorrectly Reviewed By: rzlee Differential Revision: D20447208 fbshipit-source-id: 80996fbaca77ccb7a95bfad47ce8297e14994a17 --- src/utils/pathUtils.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/pathUtils.tsx b/src/utils/pathUtils.tsx index 8c82ffc8b..d6fb12c1f 100644 --- a/src/utils/pathUtils.tsx +++ b/src/utils/pathUtils.tsx @@ -17,10 +17,12 @@ export function getStaticPath() { if (_staticPath) { return _staticPath; } + _staticPath = path.resolve(__dirname, '..', '..', 'static'); + if (fs.existsSync(_staticPath)) { + return _staticPath; + } if (remote && fs.existsSync(remote.app.getAppPath())) { - _staticPath = path.join(remote.app.getAppPath(), 'static'); - } else { - _staticPath = path.resolve(__dirname, '..', '..', 'static'); + _staticPath = path.join(remote.app.getAppPath()); } if (!fs.existsSync(_staticPath)) { throw new Error('Static path does not exist: ' + _staticPath);