Fix static path calculation
Summary: Fixed a booboo where static path was calculated incorrectly Reviewed By: rzlee Differential Revision: D20447208 fbshipit-source-id: 80996fbaca77ccb7a95bfad47ce8297e14994a17
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4ee6368cde
commit
a60e6fee87
@@ -17,10 +17,12 @@ export function getStaticPath() {
|
|||||||
if (_staticPath) {
|
if (_staticPath) {
|
||||||
return _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.resolve(__dirname, '..', '..', 'static');
|
||||||
|
if (fs.existsSync(_staticPath)) {
|
||||||
|
return _staticPath;
|
||||||
|
}
|
||||||
|
if (remote && fs.existsSync(remote.app.getAppPath())) {
|
||||||
|
_staticPath = path.join(remote.app.getAppPath());
|
||||||
}
|
}
|
||||||
if (!fs.existsSync(_staticPath)) {
|
if (!fs.existsSync(_staticPath)) {
|
||||||
throw new Error('Static path does not exist: ' + _staticPath);
|
throw new Error('Static path does not exist: ' + _staticPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user