1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0x1179=['legacy-libs','apps','findIndex','name','motion2','NODE_PATH','string','env','then','readJSON','updated','Updating\x20app.json','exports','path','../config/environment','root','resolve','server/app.json'];(function(_0x37b3f5,_0x40ed5d){var _0x28f283=function(_0x569bc4){while(--_0x569bc4){_0x37b3f5['push'](_0x37b3f5['shift']());}};_0x28f283(++_0x40ed5d);}(_0x1179,0xd3));var _0x9117=function(_0x2aa296,_0x31bfda){_0x2aa296=_0x2aa296-0x0;var _0xe9b5eb=_0x1179[_0x2aa296];return _0xe9b5eb;};var fs=require('fs-extra');var path=require(_0x9117('0x0'));var config=require(_0x9117('0x1'));var root=config[_0x9117('0x2')];var APP_JSON_PATH=path[_0x9117('0x3')](root,_0x9117('0x4'));var NODEPATH=path[_0x9117('0x3')](root,_0x9117('0x5'));function setLegacyLibsNodeEnvPath(_0x4fb041){let _0x4e1b1b=![];if(Array['isArray'](_0x4fb041[_0x9117('0x6')])){var _0x464a5d=_0x4fb041[_0x9117('0x6')][_0x9117('0x7')](function(_0x25227d){return _0x25227d[_0x9117('0x8')]===_0x9117('0x9');});if(_0x464a5d>-0x1){var _0x49555e=_0x4fb041[_0x9117('0x6')][_0x464a5d];if(typeof _0x49555e['env'][_0x9117('0xa')]!==_0x9117('0xb')){_0x49555e[_0x9117('0xc')][_0x9117('0xa')]=NODEPATH;_0x4e1b1b=!![];}}return{'appConfig':_0x4fb041,'updated':_0x4e1b1b};}}function updateAppConfig(_0x40fece){return fs['pathExists'](APP_JSON_PATH)[_0x9117('0xd')](function(_0x4a7cde){if(_0x4a7cde){return fs[_0x9117('0xe')](APP_JSON_PATH)[_0x9117('0xd')](function(_0x14a132){var _0x46b6f8=setLegacyLibsNodeEnvPath(_0x14a132);if(_0x46b6f8[_0x9117('0xf')]){_0x40fece['info'](_0x9117('0x10'));return fs['writeJSON'](APP_JSON_PATH,_0x14a132,{'spaces':0x2});}else{return Promise[_0x9117('0x3')]();}});}else{return Promise[_0x9117('0x3')]();}});}module[_0x9117('0x11')]=updateAppConfig;