Built motion from commit 449495f6.|2.6.27
[motion2.git] / server / utils / update-app-config.js
index 2dc5438..e420374 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0x35c7=['apps','findIndex','name','motion2','NODE_PATH','env','then','readJSON','updated','info','Updating\x20app.json','exports','path','../config/environment','root','resolve','server/app.json'];(function(_0x4d3924,_0x58f044){var _0x38f8d4=function(_0x5c42cf){while(--_0x5c42cf){_0x4d3924['push'](_0x4d3924['shift']());}};_0x38f8d4(++_0x58f044);}(_0x35c7,0xb6));var _0x735c=function(_0x51ccd1,_0x4db52d){_0x51ccd1=_0x51ccd1-0x0;var _0x327b4e=_0x35c7[_0x51ccd1];return _0x327b4e;};var fs=require('fs-extra');var path=require(_0x735c('0x0'));var config=require(_0x735c('0x1'));var root=config[_0x735c('0x2')];var APP_JSON_PATH=path[_0x735c('0x3')](root,_0x735c('0x4'));var NODEPATH=path[_0x735c('0x3')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x4ebd37){let _0x2804e9=![];if(Array['isArray'](_0x4ebd37[_0x735c('0x5')])){var _0x43f9c9=_0x4ebd37['apps'][_0x735c('0x6')](function(_0x3ac7e0){return _0x3ac7e0[_0x735c('0x7')]===_0x735c('0x8');});if(_0x43f9c9>-0x1){var _0x33bc38=_0x4ebd37[_0x735c('0x5')][_0x43f9c9];if(typeof _0x33bc38['env'][_0x735c('0x9')]!=='string'){_0x33bc38[_0x735c('0xa')]['NODE_PATH']=NODEPATH;_0x2804e9=!![];}}return{'appConfig':_0x4ebd37,'updated':_0x2804e9};}}function updateAppConfig(_0x23957e){return fs['pathExists'](APP_JSON_PATH)[_0x735c('0xb')](function(_0x55f923){if(_0x55f923){return fs[_0x735c('0xc')](APP_JSON_PATH)['then'](function(_0x48ee70){var _0x15dc38=setLegacyLibsNodeEnvPath(_0x48ee70);if(_0x15dc38[_0x735c('0xd')]){_0x23957e[_0x735c('0xe')](_0x735c('0xf'));return fs['writeJSON'](APP_JSON_PATH,_0x48ee70,{'spaces':0x2});}else{return Promise[_0x735c('0x3')]();}});}else{return Promise[_0x735c('0x3')]();}});}module[_0x735c('0x10')]=updateAppConfig;
\ No newline at end of file