Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / utils / update-app-config.js
index f5b8300..daa56ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6c0=['../config/environment','resolve','server/app.json','legacy-libs','isArray','apps','findIndex','name','motion2','env','NODE_PATH','string','info','Updating\x20app.json','exports','fs-extra','path'];(function(_0x26d58f,_0xf7cd46){var _0x4f372a=function(_0x431b13){while(--_0x431b13){_0x26d58f['push'](_0x26d58f['shift']());}};_0x4f372a(++_0xf7cd46);}(_0xd6c0,0xb9));var _0x0d6c=function(_0x482cce,_0x2fd9ce){_0x482cce=_0x482cce-0x0;var _0x162a9d=_0xd6c0[_0x482cce];return _0x162a9d;};var fs=require(_0x0d6c('0x0'));var path=require(_0x0d6c('0x1'));var config=require(_0x0d6c('0x2'));var root=config['root'];var APP_JSON_PATH=path[_0x0d6c('0x3')](root,_0x0d6c('0x4'));var NODEPATH=path[_0x0d6c('0x3')](root,_0x0d6c('0x5'));function setLegacyLibsNodeEnvPath(_0x580ab4){let _0x2809c0=![];if(Array[_0x0d6c('0x6')](_0x580ab4[_0x0d6c('0x7')])){var _0x4ef2f9=_0x580ab4[_0x0d6c('0x7')][_0x0d6c('0x8')](function(_0x584bdb){return _0x584bdb[_0x0d6c('0x9')]===_0x0d6c('0xa');});if(_0x4ef2f9>-0x1){var _0x35851f=_0x580ab4[_0x0d6c('0x7')][_0x4ef2f9];if(typeof _0x35851f[_0x0d6c('0xb')][_0x0d6c('0xc')]!==_0x0d6c('0xd')){_0x35851f[_0x0d6c('0xb')][_0x0d6c('0xc')]=NODEPATH;_0x2809c0=!![];}}return{'appConfig':_0x580ab4,'updated':_0x2809c0};}}function updateAppConfig(_0xa6956a){return fs['pathExists'](APP_JSON_PATH)['then'](function(_0x455591){if(_0x455591){return fs['readJSON'](APP_JSON_PATH)['then'](function(_0x75d694){var _0x11cce2=setLegacyLibsNodeEnvPath(_0x75d694);if(_0x11cce2['updated']){_0xa6956a[_0x0d6c('0xe')](_0x0d6c('0xf'));return fs['writeJSON'](APP_JSON_PATH,_0x75d694,{'spaces':0x2});}else{return Promise[_0x0d6c('0x3')]();}});}else{return Promise[_0x0d6c('0x3')]();}});}module[_0x0d6c('0x10')]=updateAppConfig;
\ No newline at end of file
+var _0x1a0e=['motion2','NODE_PATH','string','env','pathExists','then','readJSON','updated','Updating\x20app.json','exports','path','../config/environment','root','resolve','legacy-libs','isArray','apps','findIndex','name'];(function(_0xa989f6,_0x1a950e){var _0x50e6c7=function(_0x177e29){while(--_0x177e29){_0xa989f6['push'](_0xa989f6['shift']());}};_0x50e6c7(++_0x1a950e);}(_0x1a0e,0xee));var _0xe1a0=function(_0x3f2fea,_0x3c4ea8){_0x3f2fea=_0x3f2fea-0x0;var _0x69a4d5=_0x1a0e[_0x3f2fea];return _0x69a4d5;};var fs=require('fs-extra');var path=require(_0xe1a0('0x0'));var config=require(_0xe1a0('0x1'));var root=config[_0xe1a0('0x2')];var APP_JSON_PATH=path['resolve'](root,'server/app.json');var NODEPATH=path[_0xe1a0('0x3')](root,_0xe1a0('0x4'));function setLegacyLibsNodeEnvPath(_0x497300){let _0x263952=![];if(Array[_0xe1a0('0x5')](_0x497300[_0xe1a0('0x6')])){var _0x14e5a0=_0x497300[_0xe1a0('0x6')][_0xe1a0('0x7')](function(_0x250e16){return _0x250e16[_0xe1a0('0x8')]===_0xe1a0('0x9');});if(_0x14e5a0>-0x1){var _0x5c0561=_0x497300[_0xe1a0('0x6')][_0x14e5a0];if(typeof _0x5c0561['env'][_0xe1a0('0xa')]!==_0xe1a0('0xb')){_0x5c0561[_0xe1a0('0xc')]['NODE_PATH']=NODEPATH;_0x263952=!![];}}return{'appConfig':_0x497300,'updated':_0x263952};}}function updateAppConfig(_0x329a00){return fs[_0xe1a0('0xd')](APP_JSON_PATH)[_0xe1a0('0xe')](function(_0x4ee58a){if(_0x4ee58a){return fs[_0xe1a0('0xf')](APP_JSON_PATH)[_0xe1a0('0xe')](function(_0x5280af){var _0xd570bf=setLegacyLibsNodeEnvPath(_0x5280af);if(_0xd570bf[_0xe1a0('0x10')]){_0x329a00['info'](_0xe1a0('0x11'));return fs['writeJSON'](APP_JSON_PATH,_0x5280af,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0xe1a0('0x3')]();}});}module[_0xe1a0('0x12')]=updateAppConfig;
\ No newline at end of file