Built motion from commit cafec4f3.|2.6.31
[motion2.git] / server / utils / update-app-config.js
index 75a2c89..7c83219 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22ae=['fs-extra','path','../config/environment','root','resolve','server/app.json','legacy-libs','apps','findIndex','name','motion2','env','NODE_PATH','pathExists','then','info','exports'];(function(_0x1f87a3,_0x2ddc84){var _0x572824=function(_0x5bf9b3){while(--_0x5bf9b3){_0x1f87a3['push'](_0x1f87a3['shift']());}};_0x572824(++_0x2ddc84);}(_0x22ae,0x198));var _0xe22a=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x22ae[_0x289891];return _0x31cf2e;};var fs=require(_0xe22a('0x0'));var path=require(_0xe22a('0x1'));var config=require(_0xe22a('0x2'));var root=config[_0xe22a('0x3')];var APP_JSON_PATH=path[_0xe22a('0x4')](root,_0xe22a('0x5'));var NODEPATH=path[_0xe22a('0x4')](root,_0xe22a('0x6'));function setLegacyLibsNodeEnvPath(_0xf64f39){let _0x1b588d=![];if(Array['isArray'](_0xf64f39[_0xe22a('0x7')])){var _0x1ff054=_0xf64f39[_0xe22a('0x7')][_0xe22a('0x8')](function(_0x2ebe1c){return _0x2ebe1c[_0xe22a('0x9')]===_0xe22a('0xa');});if(_0x1ff054>-0x1){var _0x334476=_0xf64f39['apps'][_0x1ff054];if(typeof _0x334476[_0xe22a('0xb')]['NODE_PATH']!=='string'){_0x334476[_0xe22a('0xb')][_0xe22a('0xc')]=NODEPATH;_0x1b588d=!![];}}return{'appConfig':_0xf64f39,'updated':_0x1b588d};}}function updateAppConfig(_0x45c4f1){return fs[_0xe22a('0xd')](APP_JSON_PATH)[_0xe22a('0xe')](function(_0x453424){if(_0x453424){return fs['readJSON'](APP_JSON_PATH)[_0xe22a('0xe')](function(_0xcc0db0){var _0x3e472b=setLegacyLibsNodeEnvPath(_0xcc0db0);if(_0x3e472b['updated']){_0x45c4f1[_0xe22a('0xf')]('Updating\x20app.json');return fs['writeJSON'](APP_JSON_PATH,_0xcc0db0,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0xe22a('0x4')]();}});}module[_0xe22a('0x10')]=updateAppConfig;
\ No newline at end of file
+var _0xe573=['fs-extra','path','../config/environment','root','server/app.json','legacy-libs','apps','findIndex','name','motion2','env','NODE_PATH','string','pathExists','then','readJSON','updated','Updating\x20app.json','writeJSON','resolve','exports'];(function(_0x5adf4d,_0xdfd7ef){var _0x17b2db=function(_0x5a9a2f){while(--_0x5a9a2f){_0x5adf4d['push'](_0x5adf4d['shift']());}};_0x17b2db(++_0xdfd7ef);}(_0xe573,0x13b));var _0x3e57=function(_0x46e1c6,_0x285c1b){_0x46e1c6=_0x46e1c6-0x0;var _0x539438=_0xe573[_0x46e1c6];return _0x539438;};var fs=require(_0x3e57('0x0'));var path=require(_0x3e57('0x1'));var config=require(_0x3e57('0x2'));var root=config[_0x3e57('0x3')];var APP_JSON_PATH=path['resolve'](root,_0x3e57('0x4'));var NODEPATH=path['resolve'](root,_0x3e57('0x5'));function setLegacyLibsNodeEnvPath(_0xafa951){let _0x120e8b=![];if(Array['isArray'](_0xafa951[_0x3e57('0x6')])){var _0x5a9c2f=_0xafa951['apps'][_0x3e57('0x7')](function(_0x31c0b9){return _0x31c0b9[_0x3e57('0x8')]===_0x3e57('0x9');});if(_0x5a9c2f>-0x1){var _0x1c110f=_0xafa951['apps'][_0x5a9c2f];if(typeof _0x1c110f[_0x3e57('0xa')][_0x3e57('0xb')]!==_0x3e57('0xc')){_0x1c110f[_0x3e57('0xa')][_0x3e57('0xb')]=NODEPATH;_0x120e8b=!![];}}return{'appConfig':_0xafa951,'updated':_0x120e8b};}}function updateAppConfig(_0x47c081){return fs[_0x3e57('0xd')](APP_JSON_PATH)[_0x3e57('0xe')](function(_0x74d8c7){if(_0x74d8c7){return fs[_0x3e57('0xf')](APP_JSON_PATH)[_0x3e57('0xe')](function(_0x2e9ed6){var _0x35d664=setLegacyLibsNodeEnvPath(_0x2e9ed6);if(_0x35d664[_0x3e57('0x10')]){_0x47c081['info'](_0x3e57('0x11'));return fs[_0x3e57('0x12')](APP_JSON_PATH,_0x2e9ed6,{'spaces':0x2});}else{return Promise[_0x3e57('0x13')]();}});}else{return Promise[_0x3e57('0x13')]();}});}module[_0x3e57('0x14')]=updateAppConfig;
\ No newline at end of file