Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / utils / update-app-config.js
index 3581c29..ce6407a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec70=['name','env','string','NODE_PATH','then','readJSON','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','resolve','server/app.json','legacy-libs','apps'];(function(_0x48263c,_0x257104){var _0x47f899=function(_0x54bfc5){while(--_0x54bfc5){_0x48263c['push'](_0x48263c['shift']());}};_0x47f899(++_0x257104);}(_0xec70,0x1da));var _0x0ec7=function(_0x3beb1f,_0xc0567a){_0x3beb1f=_0x3beb1f-0x0;var _0x7ace5b=_0xec70[_0x3beb1f];return _0x7ace5b;};var fs=require(_0x0ec7('0x0'));var path=require(_0x0ec7('0x1'));var config=require('../config/environment');var root=config['root'];var APP_JSON_PATH=path[_0x0ec7('0x2')](root,_0x0ec7('0x3'));var NODEPATH=path['resolve'](root,_0x0ec7('0x4'));function setLegacyLibsNodeEnvPath(_0x2429a8){let _0x17ac04=![];if(Array['isArray'](_0x2429a8[_0x0ec7('0x5')])){var _0x38eb8e=_0x2429a8[_0x0ec7('0x5')]['findIndex'](function(_0x302f7a){return _0x302f7a[_0x0ec7('0x6')]==='motion2';});if(_0x38eb8e>-0x1){var _0x3cf420=_0x2429a8[_0x0ec7('0x5')][_0x38eb8e];if(typeof _0x3cf420[_0x0ec7('0x7')]['NODE_PATH']!==_0x0ec7('0x8')){_0x3cf420[_0x0ec7('0x7')][_0x0ec7('0x9')]=NODEPATH;_0x17ac04=!![];}}return{'appConfig':_0x2429a8,'updated':_0x17ac04};}}function updateAppConfig(_0x30ac37){return fs['pathExists'](APP_JSON_PATH)[_0x0ec7('0xa')](function(_0x3feebb){if(_0x3feebb){return fs[_0x0ec7('0xb')](APP_JSON_PATH)['then'](function(_0x2e4dd3){var _0x5e4ceb=setLegacyLibsNodeEnvPath(_0x2e4dd3);if(_0x5e4ceb['updated']){_0x30ac37[_0x0ec7('0xc')](_0x0ec7('0xd'));return fs[_0x0ec7('0xe')](APP_JSON_PATH,_0x2e4dd3,{'spaces':0x2});}else{return Promise[_0x0ec7('0x2')]();}});}else{return Promise['resolve']();}});}module[_0x0ec7('0xf')]=updateAppConfig;
\ No newline at end of file
+var _0xd9d5=['writeJSON','exports','fs-extra','path','../config/environment','resolve','server/app.json','isArray','apps','findIndex','motion2','env','NODE_PATH','string','pathExists','then','readJSON','updated','Updating\x20app.json'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xd9d5,0x1dd));var _0x5d9d=function(_0x1c7020,_0x17085a){_0x1c7020=_0x1c7020-0x0;var _0x38363d=_0xd9d5[_0x1c7020];return _0x38363d;};var fs=require(_0x5d9d('0x0'));var path=require(_0x5d9d('0x1'));var config=require(_0x5d9d('0x2'));var root=config['root'];var APP_JSON_PATH=path[_0x5d9d('0x3')](root,_0x5d9d('0x4'));var NODEPATH=path[_0x5d9d('0x3')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0xbb05bf){let _0x2741ff=![];if(Array[_0x5d9d('0x5')](_0xbb05bf[_0x5d9d('0x6')])){var _0x3a77bd=_0xbb05bf[_0x5d9d('0x6')][_0x5d9d('0x7')](function(_0x31285e){return _0x31285e['name']===_0x5d9d('0x8');});if(_0x3a77bd>-0x1){var _0x45f536=_0xbb05bf[_0x5d9d('0x6')][_0x3a77bd];if(typeof _0x45f536[_0x5d9d('0x9')][_0x5d9d('0xa')]!==_0x5d9d('0xb')){_0x45f536[_0x5d9d('0x9')]['NODE_PATH']=NODEPATH;_0x2741ff=!![];}}return{'appConfig':_0xbb05bf,'updated':_0x2741ff};}}function updateAppConfig(_0x5b3f0e){return fs[_0x5d9d('0xc')](APP_JSON_PATH)[_0x5d9d('0xd')](function(_0x4fdd2c){if(_0x4fdd2c){return fs[_0x5d9d('0xe')](APP_JSON_PATH)[_0x5d9d('0xd')](function(_0x40c166){var _0x3e21ee=setLegacyLibsNodeEnvPath(_0x40c166);if(_0x3e21ee[_0x5d9d('0xf')]){_0x5b3f0e['info'](_0x5d9d('0x10'));return fs[_0x5d9d('0x11')](APP_JSON_PATH,_0x40c166,{'spaces':0x2});}else{return Promise[_0x5d9d('0x3')]();}});}else{return Promise[_0x5d9d('0x3')]();}});}module[_0x5d9d('0x12')]=updateAppConfig;
\ No newline at end of file