Built motion from commit 97153652.|2.6.26
[motion2.git] / server / utils / update-app-config.js
index 93a6bdb..2dc5438 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26c5=['apps','motion2','env','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','root','resolve','server/app.json','legacy-libs','isArray'];(function(_0x47694e,_0x7b34f1){var _0xaa6cef=function(_0xa25266){while(--_0xa25266){_0x47694e['push'](_0x47694e['shift']());}};_0xaa6cef(++_0x7b34f1);}(_0x26c5,0xd6));var _0x526c=function(_0x5140a4,_0x557d73){_0x5140a4=_0x5140a4-0x0;var _0x37238e=_0x26c5[_0x5140a4];return _0x37238e;};var fs=require(_0x526c('0x0'));var path=require(_0x526c('0x1'));var config=require('../config/environment');var root=config[_0x526c('0x2')];var APP_JSON_PATH=path[_0x526c('0x3')](root,_0x526c('0x4'));var NODEPATH=path[_0x526c('0x3')](root,_0x526c('0x5'));function setLegacyLibsNodeEnvPath(_0x40aaa0){let _0x125255=![];if(Array[_0x526c('0x6')](_0x40aaa0[_0x526c('0x7')])){var _0x2eeaa7=_0x40aaa0['apps']['findIndex'](function(_0x197af8){return _0x197af8['name']===_0x526c('0x8');});if(_0x2eeaa7>-0x1){var _0x1e3684=_0x40aaa0[_0x526c('0x7')][_0x2eeaa7];if(typeof _0x1e3684['env']['NODE_PATH']!=='string'){_0x1e3684[_0x526c('0x9')]['NODE_PATH']=NODEPATH;_0x125255=!![];}}return{'appConfig':_0x40aaa0,'updated':_0x125255};}}function updateAppConfig(_0x3affbc){return fs['pathExists'](APP_JSON_PATH)[_0x526c('0xa')](function(_0x4b6a00){if(_0x4b6a00){return fs[_0x526c('0xb')](APP_JSON_PATH)['then'](function(_0x3366f2){var _0x36398b=setLegacyLibsNodeEnvPath(_0x3366f2);if(_0x36398b[_0x526c('0xc')]){_0x3affbc[_0x526c('0xd')](_0x526c('0xe'));return fs[_0x526c('0xf')](APP_JSON_PATH,_0x3366f2,{'spaces':0x2});}else{return Promise[_0x526c('0x3')]();}});}else{return Promise[_0x526c('0x3')]();}});}module[_0x526c('0x10')]=updateAppConfig;
\ No newline at end of file
+var _0xf80f=['fs-extra','root','resolve','server/app.json','isArray','apps','findIndex','name','motion2','NODE_PATH','string','env','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports'];(function(_0x1ce2bd,_0x222e48){var _0x53d1e7=function(_0x5f3db2){while(--_0x5f3db2){_0x1ce2bd['push'](_0x1ce2bd['shift']());}};_0x53d1e7(++_0x222e48);}(_0xf80f,0x169));var _0xff80=function(_0x5a2575,_0x5cdfff){_0x5a2575=_0x5a2575-0x0;var _0x567ed3=_0xf80f[_0x5a2575];return _0x567ed3;};var fs=require(_0xff80('0x0'));var path=require('path');var config=require('../config/environment');var root=config[_0xff80('0x1')];var APP_JSON_PATH=path[_0xff80('0x2')](root,_0xff80('0x3'));var NODEPATH=path[_0xff80('0x2')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x350f75){let _0x43bec0=![];if(Array[_0xff80('0x4')](_0x350f75[_0xff80('0x5')])){var _0x12ade3=_0x350f75[_0xff80('0x5')][_0xff80('0x6')](function(_0x4476a2){return _0x4476a2[_0xff80('0x7')]===_0xff80('0x8');});if(_0x12ade3>-0x1){var _0x164179=_0x350f75[_0xff80('0x5')][_0x12ade3];if(typeof _0x164179['env'][_0xff80('0x9')]!==_0xff80('0xa')){_0x164179[_0xff80('0xb')][_0xff80('0x9')]=NODEPATH;_0x43bec0=!![];}}return{'appConfig':_0x350f75,'updated':_0x43bec0};}}function updateAppConfig(_0x5d2bd0){return fs['pathExists'](APP_JSON_PATH)[_0xff80('0xc')](function(_0x18e358){if(_0x18e358){return fs[_0xff80('0xd')](APP_JSON_PATH)[_0xff80('0xc')](function(_0xb50493){var _0xb59d89=setLegacyLibsNodeEnvPath(_0xb50493);if(_0xb59d89[_0xff80('0xe')]){_0x5d2bd0[_0xff80('0xf')](_0xff80('0x10'));return fs[_0xff80('0x11')](APP_JSON_PATH,_0xb50493,{'spaces':0x2});}else{return Promise[_0xff80('0x2')]();}});}else{return Promise[_0xff80('0x2')]();}});}module[_0xff80('0x12')]=updateAppConfig;
\ No newline at end of file