gemit-cli 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const _0x569f71=_0x1976;(function(_0x4212fc,_0x95ce30){const _0x564ef6=_0x1976,_0x36e76d=_0x4212fc();while(!![]){try{const _0x1fdefe=parseInt(_0x564ef6(0x197))/0x1+parseInt(_0x564ef6(0x170))/0x2*(-parseInt(_0x564ef6(0x156))/0x3)+parseInt(_0x564ef6(0x1d3))/0x4+parseInt(_0x564ef6(0x187))/0x5+-parseInt(_0x564ef6(0x158))/0x6*(parseInt(_0x564ef6(0x17a))/0x7)+-parseInt(_0x564ef6(0x1c9))/0x8+-parseInt(_0x564ef6(0x1c0))/0x9;if(_0x1fdefe===_0x95ce30)break;else _0x36e76d['push'](_0x36e76d['shift']());}catch(_0x5f4c8a){_0x36e76d['push'](_0x36e76d['shift']());}}}(_0xe7d4,0x787e7));const _0x553347=(function(){const _0x41b1a4=_0x1976,_0x559e03={'lKLuL':function(_0x1e3144,_0x1f918f){return _0x1e3144(_0x1f918f);},'ywsmJ':function(_0x4866b6,_0x458d3c){return _0x4866b6===_0x458d3c;},'GvleT':_0x41b1a4(0x15e)};let _0x21f6f1=!![];return function(_0xd7627f,_0x510e0f){const _0x1579ce=_0x41b1a4,_0xa4c917={'SBZQW':function(_0x4bb569,_0x209d0d){return _0x559e03['lKLuL'](_0x4bb569,_0x209d0d);}};if(_0x559e03['ywsmJ'](_0x559e03[_0x1579ce(0x190)],'knfoX')){const _0x51cb1c=_0x21f6f1?function(){const _0x290672=_0x1579ce;if(_0x510e0f){const _0x2a740e=_0x510e0f[_0x290672(0x1a4)](_0xd7627f,arguments);return _0x510e0f=null,_0x2a740e;}}:function(){};return _0x21f6f1=![],_0x51cb1c;}else _0xa4c917['SBZQW'](_0x1504e2,![]);};}()),_0x2932f2=_0x553347(this,function(){const _0x1429f7=_0x1976,_0xc09b1a={'HvzSJ':_0x1429f7(0x1d6)+_0x1429f7(0x1d5)};return _0x2932f2[_0x1429f7(0x166)]()[_0x1429f7(0x175)](_0xc09b1a['HvzSJ'])[_0x1429f7(0x166)]()[_0x1429f7(0x19c)+_0x1429f7(0x13e)](_0x2932f2)[_0x1429f7(0x175)](_0x1429f7(0x1d6)+'+)+$');});_0x2932f2();import{mkdirSync,readFileSync,writeFileSync}from'fs';import{spawn}from'child_process';function _0x1976(_0x3a3609,_0x182512){_0x3a3609=_0x3a3609-0x13e;const _0x218502=_0xe7d4();let _0x2932f2=_0x218502[_0x3a3609];return _0x2932f2;}function _0xe7d4(){const _0x146b67=['UPDATE\x20S','zXzCL','orm\x20the\x20','WDTbL','exit','hJIxm','UPDATE','update.','cted\x20(','pAkuF','NLugq','FvAow','lhdIN','rg/','jVLhm','stringif','2253QYYlVN','gemit-cl','6cmhGHl','version','OJuEk','ion\x20dete','oUqYk','HTjUG','knfoX','kill','start','WQzdd','ignore','/latest','WAIT','UPDATED','toString','\x20->\x20','indow\x20wa','string','--help','k\x20your\x20c','tqLde','win32','gemit\x20is','xEoPs','676rLUztg','isFinite','XsVSu','UPDATE\x20F','wxVve','search','--versio','xgYif','jsnec','TrcCO','419601sZJmQb','hQnCN','length','CRIZx','ywIJe','AhDPf','MmtKm','New\x20vers','parse','utf8','lfmta','Run\x20manu','dGazw','4661740YRgmze','signal','uRybM','Please\x20w','iFsHB','mHzTj','lastChec','ally:\x20np','@latest','GvleT','includes','kfvKc','init','install','ktEiZ','\x20-g\x20','764511uohqKW','s\x20opened','\x20&\x20echo.','qttJt','losNd','construc','ate\x20(','rpAPg','abort','QyYoN','o\x20fetch\x20','log','BYYLw','apply','.npmjs.o','json','cmd.exe','[Update\x20','ETaAJ','vNniq','npm','trim','now','rminal\x20w','Failed\x20t','atOsf','st\x20versi','the\x20upda','ytrQK','slice','ore\x20runn','the\x20late','object','\x20&\x20echo\x20','t\x20again.','npm.cmd','TARTED','HAmkE','Finished','te\x20to\x20fi','error','3389859Vupxrm','YMEvC','on.\x20Chec',']\x20&\x20paus','vnCsW','\x20up\x20to\x20d','AILED','cSkAl','salkZ','4245568SALXTs','UGeyf','startsWi','CcLZE','ExjBQ','A\x20new\x20te','ait\x20for\x20','m\x20i\x20-g\x20','update-c','cUNIF','71248zxSJGA','ezEAY','+)+$','(((.+)+)','onnectio','split','tor','replace','kedAt','registry','ybOjs','fJbeK','ZfxuV','PkeGH'];_0xe7d4=function(){return _0x146b67;};return _0xe7d4();}import{dirname,join}from'path';import{getGlobalEnvPath}from'./config.js';import{getCliVersion}from'./cli-version.js';import{bad,ok,warn}from'./ui.js';const PACKAGE_NAME=_0x569f71(0x157)+'i',CHECK_INTERVAL_MS=0x3e8*0x3c*0x3c*0xc,CHECK_TIMEOUT_MS=0x9c4,UPDATE_TIMEOUT_MS=0x3e8*0x3c*0x2;export async function maybeAutoUpdate(_0x3efd6d,_0x248563=![]){const _0x376c22=_0x569f71,_0x7d34b3={'BYYLw':_0x376c22(0x173)+_0x376c22(0x1c6),'lfmta':function(_0x48c623,_0x3639f3){return _0x48c623===_0x3639f3;},'dcqLm':function(_0x1dbe03,_0x4463dd){return _0x1dbe03(_0x4463dd);},'ksYZy':function(_0x2c42b5,_0xf12d4f){return _0x2c42b5<_0xf12d4f;},'LJEtE':function(_0x34fa6b,_0x5a5ce2){return _0x34fa6b-_0x5a5ce2;},'OJuEk':function(_0x106223,_0x26cecd,_0x3fa264){return _0x106223(_0x26cecd,_0x3fa264);},'xgYif':_0x376c22(0x14c),'ohRYO':_0x376c22(0x1af)+_0x376c22(0x1a1)+_0x376c22(0x1b6)+_0x376c22(0x1b1)+_0x376c22(0x1c2)+_0x376c22(0x16b)+_0x376c22(0x1d7)+'n.','qttJt':function(_0x483eec){return _0x483eec();},'AhDPf':function(_0x6c8e17,_0x1f99d8){return _0x6c8e17!==_0x1f99d8;},'KxwwY':'EHJhC','rpAPg':_0x376c22(0x1d4),'WDTbL':function(_0x48b7a5){return _0x48b7a5();},'jVLhm':'detached','QyYoN':_0x376c22(0x146)+_0x376c22(0x1bb),'mHzTj':_0x376c22(0x1ce)+_0x376c22(0x1ae)+_0x376c22(0x168)+_0x376c22(0x198)+'\x20to\x20perf'+_0x376c22(0x148)+_0x376c22(0x14d),'dGazw':function(_0xe6b7c6,_0x1a7995,_0x23ae83){return _0xe6b7c6(_0x1a7995,_0x23ae83);},'ytrQK':_0x376c22(0x164),'PiLHd':_0x376c22(0x18a)+_0x376c22(0x1cf)+_0x376c22(0x1b2)+_0x376c22(0x1be)+'nish\x20bef'+_0x376c22(0x1b5)+'ing\x20gemi'+_0x376c22(0x1b9),'xEoPs':function(_0x361156,_0x1c79b9,_0x56e1f4){return _0x361156(_0x1c79b9,_0x56e1f4);},'atOsf':function(_0x40fdc2,_0x91c5f7,_0x2523c2){return _0x40fdc2(_0x91c5f7,_0x2523c2);}};if(_0x7d34b3[_0x376c22(0x184)](process.env.GEMIT_DISABLE_AUTO_UPDATE,'1')&&!_0x248563)return;if(!_0x7d34b3['dcqLm'](shouldCheckForUpdates,_0x3efd6d)&&!_0x248563)return;const _0x3e3c06=readCache(),_0xd3d851=Date[_0x376c22(0x1ad)]();if(!_0x248563&&_0x3e3c06[_0x376c22(0x18d)+_0x376c22(0x140)]&&_0x7d34b3['ksYZy'](_0x7d34b3['LJEtE'](_0xd3d851,_0x3e3c06['lastChec'+_0x376c22(0x140)]),CHECK_INTERVAL_MS))return;const _0x2187b3=await fetchLatestVersion();if(!_0x2187b3){_0x248563&&console['log'](_0x7d34b3[_0x376c22(0x15a)](bad,_0x7d34b3[_0x376c22(0x177)],_0x7d34b3['ohRYO']));return;}!_0x248563&&writeCache({'lastCheckedAt':_0xd3d851});const _0x2c0310=_0x7d34b3[_0x376c22(0x19a)](getCliVersion);if(!_0x7d34b3[_0x376c22(0x15a)](isVersionLower,_0x2c0310,_0x2187b3)){if(_0x7d34b3[_0x376c22(0x17f)](_0x7d34b3['KxwwY'],_0x7d34b3[_0x376c22(0x19e)])){_0x248563&&console[_0x376c22(0x1a2)](ok(_0x7d34b3[_0x376c22(0x177)],_0x376c22(0x16e)+_0x376c22(0x1c5)+_0x376c22(0x19d)+_0x2c0310+').'));return;}else _0x29f2ab[_0x376c22(0x1a2)](_0x44b0ca(_0x7d34b3[_0x376c22(0x1a3)],_0x376c22(0x185)+_0x376c22(0x18e)+'m\x20i\x20-g\x20'+_0x26c802+_0x376c22(0x18f)));}console['log'](_0x7d34b3['OJuEk'](warn,_0x7d34b3['xgYif'],_0x376c22(0x181)+_0x376c22(0x15b)+_0x376c22(0x14e)+_0x2c0310+_0x376c22(0x167)+_0x2187b3+').'));const _0x4a3b58=await _0x7d34b3[_0x376c22(0x149)](runGlobalUpdate);if(_0x4a3b58===_0x7d34b3[_0x376c22(0x154)])console[_0x376c22(0x1a2)](_0x7d34b3[_0x376c22(0x15a)](ok,_0x7d34b3[_0x376c22(0x1a0)],_0x7d34b3[_0x376c22(0x18c)])),console['log'](_0x7d34b3[_0x376c22(0x186)](warn,_0x7d34b3[_0x376c22(0x1b3)],_0x7d34b3['PiLHd']));else _0x4a3b58?console[_0x376c22(0x1a2)](_0x7d34b3[_0x376c22(0x16f)](ok,_0x376c22(0x165),_0x376c22(0x16e)+'\x20now\x20on\x20'+_0x2187b3+'.')):console['log'](_0x7d34b3[_0x376c22(0x1b0)](bad,_0x7d34b3['BYYLw'],_0x376c22(0x185)+_0x376c22(0x18e)+_0x376c22(0x1d0)+PACKAGE_NAME+_0x376c22(0x18f)));}function shouldCheckForUpdates(_0x31fa85){const _0x143464=_0x569f71,_0x5d5095={'xEPrY':_0x143464(0x16a),'MHbOD':function(_0x5ec7bc,_0x5543cf){return _0x5ec7bc!==_0x5543cf;},'FWdpJ':_0x143464(0x193),'ybOjs':function(_0x205241,_0x5ea864){return _0x205241!==_0x5ea864;},'ReNik':'doctor'};if(_0x31fa85[_0x143464(0x17c)]<=0x2)return!![];const _0x4a347a=_0x31fa85[_0x143464(0x1b4)](0x2);if(_0x4a347a[_0x143464(0x191)]('-h')||_0x4a347a['includes'](_0x5d5095['xEPrY'])||_0x4a347a['includes']('-v')||_0x4a347a[_0x143464(0x191)](_0x143464(0x176)+'n'))return![];const _0x318b60=_0x4a347a['find'](_0x48152c=>!_0x48152c[_0x143464(0x1cb)+'th']('-'));if(!_0x318b60)return![];return _0x5d5095['MHbOD'](_0x318b60,_0x5d5095['FWdpJ'])&&_0x5d5095[_0x143464(0x142)](_0x318b60,_0x5d5095['ReNik']);}async function fetchLatestVersion(){const _0x2292c3=_0x569f71,_0x1fe189={'losNd':function(_0x58498e,_0x303d63,_0x4dbdd4){return _0x58498e(_0x303d63,_0x4dbdd4);},'zXzCL':_0x2292c3(0x169),'AOgXJ':function(_0x1c2a89,_0x35e902){return _0x1c2a89===_0x35e902;},'ZfxuV':_0x2292c3(0x17b),'BXWdN':_0x2292c3(0x192),'CRIZx':function(_0x2aa7f7,_0x21db70){return _0x2aa7f7(_0x21db70);}},_0x45aa0c=new AbortController(),_0x1df864=_0x1fe189[_0x2292c3(0x19b)](setTimeout,()=>_0x45aa0c[_0x2292c3(0x19f)](),CHECK_TIMEOUT_MS);try{const _0x302895=await _0x1fe189[_0x2292c3(0x19b)](fetch,'https://'+_0x2292c3(0x141)+_0x2292c3(0x1a5)+_0x2292c3(0x153)+PACKAGE_NAME+_0x2292c3(0x163),{'signal':_0x45aa0c[_0x2292c3(0x188)]});if(!_0x302895['ok'])return null;const _0x5308bf=await _0x302895[_0x2292c3(0x1a6)]();return typeof _0x5308bf[_0x2292c3(0x159)]===_0x1fe189[_0x2292c3(0x147)]?_0x5308bf[_0x2292c3(0x159)]:null;}catch{if(_0x1fe189['AOgXJ'](_0x1fe189[_0x2292c3(0x144)],_0x1fe189['BXWdN']))return;else return null;}finally{_0x1fe189[_0x2292c3(0x17d)](clearTimeout,_0x1df864);}}async function runGlobalUpdate(){const _0x185f49=_0x569f71,_0x1a673f={'MmtKm':function(_0x561a9f,_0xf0e9d5){return _0x561a9f(_0xf0e9d5);},'CcLZE':function(_0x310c1b,_0x1b0644){return _0x310c1b===_0x1b0644;},'cSkAl':function(_0x21b192,_0xdcbcb3){return _0x21b192(_0xdcbcb3);},'rSfJA':_0x185f49(0x16c),'cUNIF':function(_0x4d00a7,_0x14dcae,_0x2c356a,_0x39b4e2){return _0x4d00a7(_0x14dcae,_0x2c356a,_0x39b4e2);},'UGeyf':_0x185f49(0x1ab),'ExjBQ':_0x185f49(0x194),'salkZ':function(_0x1e8963,_0x66d15a,_0x6f141f){return _0x1e8963(_0x66d15a,_0x6f141f);},'HAmkE':_0x185f49(0x1bf),'CFZKJ':_0x185f49(0x14a),'hJIxm':function(_0x12f814,_0x18f288){return _0x12f814(_0x18f288);},'qypIp':_0x185f49(0x16d),'oUqYk':_0x185f49(0x1ba),'TrcCO':function(_0x2195ac,_0x5ea8df,_0x4ed6ac,_0x3c0931){return _0x2195ac(_0x5ea8df,_0x4ed6ac,_0x3c0931);},'FvAow':'ignore','RnGhs':'detached'};if(_0x1a673f[_0x185f49(0x1cc)](process['platform'],_0x1a673f['qypIp']))try{const _0x20a6ff=_0x1a673f[_0x185f49(0x15c)],_0x6b0ce1=_0x20a6ff+('\x20install'+_0x185f49(0x196))+PACKAGE_NAME+_0x185f49(0x18f),_0x38974d=_0x6b0ce1+(_0x185f49(0x199)+_0x185f49(0x1b8)+_0x185f49(0x1a8)+_0x185f49(0x1bd)+_0x185f49(0x1c3)+'e');return _0x1a673f[_0x185f49(0x179)](spawn,_0x185f49(0x1a7),['/c',_0x185f49(0x160),_0x185f49(0x1a7),'/c',_0x38974d],{'detached':!![],'stdio':_0x1a673f[_0x185f49(0x151)]})['unref'](),_0x1a673f['RnGhs'];}catch{return![];}return new Promise(_0x5740e5=>{const _0x3dfa5a=_0x185f49,_0x33246b={'jsnec':function(_0x135b57,_0x45319f){return _0x135b57!==_0x45319f;},'XsVSu':_0x3dfa5a(0x1a9),'fraTq':function(_0x3dacdf,_0x4b5b95){const _0x2b35ad=_0x3dfa5a;return _0x1a673f[_0x2b35ad(0x1c7)](_0x3dacdf,_0x4b5b95);},'HTjUG':_0x1a673f['rSfJA']};try{const _0x201a08=_0x1a673f[_0x3dfa5a(0x1d2)](spawn,_0x1a673f[_0x3dfa5a(0x1ca)],[_0x1a673f[_0x3dfa5a(0x1cd)],'-g',PACKAGE_NAME+'@latest'],{'stdio':_0x3dfa5a(0x162)}),_0x5cc027=_0x1a673f[_0x3dfa5a(0x1c8)](setTimeout,()=>{const _0x45b7e3=_0x3dfa5a;if(_0x33246b[_0x45b7e3(0x178)](_0x33246b[_0x45b7e3(0x172)],_0x45b7e3(0x1a9)))return![];else _0x201a08[_0x45b7e3(0x15f)](),_0x33246b['fraTq'](_0x5740e5,![]);},UPDATE_TIMEOUT_MS);_0x201a08['on'](_0x1a673f[_0x3dfa5a(0x1bc)],()=>{const _0x592aeb=_0x3dfa5a;if(_0x33246b[_0x592aeb(0x15d)]===_0x33246b[_0x592aeb(0x15d)])_0x33246b['fraTq'](clearTimeout,_0x5cc027),_0x5740e5(![]);else return null;}),_0x201a08['on'](_0x1a673f['CFZKJ'],_0x48c085=>{const _0x261fa1=_0x3dfa5a;_0x1a673f[_0x261fa1(0x180)](clearTimeout,_0x5cc027),_0x1a673f[_0x261fa1(0x180)](_0x5740e5,_0x1a673f['CcLZE'](_0x48c085,0x0));});}catch{_0x1a673f[_0x3dfa5a(0x14b)](_0x5740e5,![]);}});}function getCachePath(){const _0x5b6ae0=_0x569f71,_0x3c0ba4={'YMEvC':function(_0x4b4047,_0x25133a){return _0x4b4047(_0x25133a);},'uRybM':_0x5b6ae0(0x1d1)+'heck.jso'+'n'};return join(_0x3c0ba4[_0x5b6ae0(0x1c1)](dirname,getGlobalEnvPath()),_0x3c0ba4[_0x5b6ae0(0x189)]);}function readCache(){const _0x23a3d5=_0x569f71,_0x55a07f={'NLugq':function(_0xbd2bfd,_0x17d468,_0x4928c0){return _0xbd2bfd(_0x17d468,_0x4928c0);},'ywIJe':function(_0x5c0d02){return _0x5c0d02();},'vnCsW':_0x23a3d5(0x183),'WQzdd':function(_0x2b8315,_0x104424){return _0x2b8315===_0x104424;},'dmcuM':_0x23a3d5(0x1b7)};try{const _0x3b012a=_0x55a07f[_0x23a3d5(0x150)](readFileSync,_0x55a07f[_0x23a3d5(0x17e)](getCachePath),_0x55a07f[_0x23a3d5(0x1c4)]),_0x2286c5=JSON[_0x23a3d5(0x182)](_0x3b012a);return _0x2286c5&&_0x55a07f[_0x23a3d5(0x161)](typeof _0x2286c5,_0x55a07f['dmcuM'])?_0x2286c5:{};}catch{return{};}}function writeCache(_0x379800){const _0x10f253=_0x569f71,_0x4da8bf={'ktEiZ':function(_0xfd837b){return _0xfd837b();},'LAsul':function(_0x34f017,_0x3c9d3d,_0x4a095b){return _0x34f017(_0x3c9d3d,_0x4a095b);},'pAkuF':function(_0x563e7c,_0x4a69aa){return _0x563e7c(_0x4a69aa);},'iFsHB':function(_0x2110ca,_0x5315ee,_0x118f19,_0x24bd4e){return _0x2110ca(_0x5315ee,_0x118f19,_0x24bd4e);},'fJbeK':_0x10f253(0x183)};try{const _0x5ee158=_0x4da8bf[_0x10f253(0x195)](getCachePath);_0x4da8bf['LAsul'](mkdirSync,_0x4da8bf[_0x10f253(0x14f)](dirname,_0x5ee158),{'recursive':!![]}),_0x4da8bf[_0x10f253(0x18b)](writeFileSync,_0x5ee158,JSON[_0x10f253(0x155)+'y'](_0x379800),_0x4da8bf[_0x10f253(0x143)]);}catch{}}function isVersionLower(_0x263676,_0x46a735){const _0x74cf6=_0x569f71,_0x43374b={'vNniq':function(_0x34b8f4,_0x28e36c){return _0x34b8f4(_0x28e36c);},'lhdIN':function(_0x5b7c6a,_0x2ea675){return _0x5b7c6a<_0x2ea675;},'BSDeo':function(_0x3b3013,_0xdee280){return _0x3b3013>_0xdee280;}},_0x311cec=_0x43374b[_0x74cf6(0x1aa)](normalizeVersion,_0x263676),_0x3dd3a8=normalizeVersion(_0x46a735);if(!_0x311cec||!_0x3dd3a8)return![];for(let _0x35b10e=0x0;_0x35b10e<0x3;_0x35b10e+=0x1){if(_0x43374b[_0x74cf6(0x152)](_0x311cec[_0x35b10e],_0x3dd3a8[_0x35b10e]))return!![];if(_0x43374b['BSDeo'](_0x311cec[_0x35b10e],_0x3dd3a8[_0x35b10e]))return![];}return![];}function normalizeVersion(_0x8f0572){const _0x468075=_0x569f71,_0x527475={'wxVve':function(_0xb71527,_0x52c498){return _0xb71527<_0x52c498;},'PkeGH':function(_0x385632,_0x436f55){return _0x385632(_0x436f55);}},_0x5f3765=_0x8f0572[_0x468075(0x1ac)]()[_0x468075(0x13f)](/^v/i,'')[_0x468075(0x1d8)]('-')[0x0],_0x93c82c=_0x5f3765['split']('.');if(_0x527475[_0x468075(0x174)](_0x93c82c[_0x468075(0x17c)],0x3))return null;const _0x199fa0=_0x527475[_0x468075(0x145)](Number,_0x93c82c[0x0]),_0xdf57e=Number(_0x93c82c[0x1]),_0x32aa82=Number(_0x93c82c[0x2]);if(!Number[_0x468075(0x171)](_0x199fa0)||!Number['isFinite'](_0xdf57e)||!Number['isFinite'](_0x32aa82))return null;return[_0x199fa0,_0xdf57e,_0x32aa82];}
1
+ (function(_0x1afed0,_0xf5902){const _0x4120bb=_0x492e,_0xcd8452=_0x1afed0();while(!![]){try{const _0x14bde1=parseInt(_0x4120bb(0x197))/0x1+-parseInt(_0x4120bb(0x1ce))/0x2+-parseInt(_0x4120bb(0x1c7))/0x3*(-parseInt(_0x4120bb(0x16d))/0x4)+-parseInt(_0x4120bb(0x17f))/0x5+-parseInt(_0x4120bb(0x16a))/0x6+-parseInt(_0x4120bb(0x14a))/0x7+parseInt(_0x4120bb(0x14d))/0x8*(parseInt(_0x4120bb(0x1c4))/0x9);if(_0x14bde1===_0xf5902)break;else _0xcd8452['push'](_0xcd8452['shift']());}catch(_0x35a26e){_0xcd8452['push'](_0xcd8452['shift']());}}}(_0x3e84,0x497d2));const _0x1ab8f6=(function(){const _0x2fbfa9={'jUlqJ':function(_0x18a6c1,_0x39b8f8){return _0x18a6c1(_0x39b8f8);},'yGCjg':function(_0x3ad125,_0x246253){return _0x3ad125===_0x246253;},'cwPuB':'EFQdd'};let _0x5ef469=!![];return function(_0x19ba90,_0x33a3e6){const _0x7047d0=_0x492e,_0x5f5074={'iSaCV':function(_0x285ed6,_0x2cc2f8){return _0x2fbfa9['jUlqJ'](_0x285ed6,_0x2cc2f8);},'jMyVp':function(_0x2b7aa2,_0x453c49){const _0x1eb310=_0x492e;return _0x2fbfa9[_0x1eb310(0x195)](_0x2b7aa2,_0x453c49);},'xsrgn':_0x2fbfa9[_0x7047d0(0x1d0)]},_0x382030=_0x5ef469?function(){const _0x20c9f3=_0x7047d0,_0x584ce3={'MxeEo':function(_0x1711b9,_0x456f23,_0x10df3d){return _0x1711b9(_0x456f23,_0x10df3d);},'oBcfI':function(_0x4643f2,_0x4e5c8e){const _0x3610de=_0x492e;return _0x5f5074[_0x3610de(0x186)](_0x4643f2,_0x4e5c8e);}};if(_0x33a3e6){if(_0x5f5074[_0x20c9f3(0x1bc)](_0x5f5074[_0x20c9f3(0x1d6)],_0x5f5074['xsrgn'])){const _0x5c2b50=_0x33a3e6[_0x20c9f3(0x162)](_0x19ba90,arguments);return _0x33a3e6=null,_0x5c2b50;}else try{const _0x521761=_0x3bcbf0();_0x584ce3[_0x20c9f3(0x1bb)](_0x33d7ff,_0x584ce3['oBcfI'](_0x4c4af3,_0x521761),{'recursive':!![]}),_0x161951(_0x521761,_0x176f76['stringif'+'y'](_0x2ff049),_0x20c9f3(0x1b5));}catch{}}}:function(){};return _0x5ef469=![],_0x382030;};}()),_0x52271e=_0x1ab8f6(this,function(){const _0x35e52b=_0x492e,_0x53fdb2={'NDCzQ':_0x35e52b(0x190)+_0x35e52b(0x176)};return _0x52271e[_0x35e52b(0x1b3)]()[_0x35e52b(0x16c)](_0x53fdb2['NDCzQ'])[_0x35e52b(0x1b3)]()['construc'+'tor'](_0x52271e)[_0x35e52b(0x16c)](_0x53fdb2[_0x35e52b(0x159)]);});_0x52271e();import{mkdirSync,readFileSync,writeFileSync}from'fs';import{spawn}from'child_process';import{dirname,join}from'path';import{getGlobalEnvPath}from'./config.js';import{getCliVersion}from'./cli-version.js';import{bad,ok,warn}from'./ui.js';const PACKAGE_NAME='gemit-cl'+'i',CHECK_INTERVAL_MS=0x3e8*0x3c*0x3c*0xc,CHECK_TIMEOUT_MS=0x9c4,UPDATE_TIMEOUT_MS=0x3e8*0x3c*0x2;function _0x492e(_0x1ff732,_0x1ec714){_0x1ff732=_0x1ff732-0x147;const _0x15a3a0=_0x3e84();let _0x52271e=_0x15a3a0[_0x1ff732];return _0x52271e;}export async function maybeAutoUpdate(_0x302932,_0x26cfe6=![]){const _0x46f021=_0x492e,_0x52d59a={'eCKgc':function(_0x59c20e,_0x438540){return _0x59c20e>_0x438540;},'ksKby':function(_0x475002,_0x26c2f5){return _0x475002===_0x26c2f5;},'EIbkG':function(_0x5e87ef,_0x55dc2f){return _0x5e87ef(_0x55dc2f);},'HKxMh':_0x46f021(0x19c),'AEYpF':function(_0x4cdf50){return _0x4cdf50();},'wLcQJ':function(_0x2c3208,_0x1233a2){return _0x2c3208<_0x1233a2;},'SCYHx':function(_0x51d358){return _0x51d358();},'hlltX':function(_0x190aac,_0x32edbd,_0x530345){return _0x190aac(_0x32edbd,_0x530345);},'AJVTw':_0x46f021(0x193),'FztBz':function(_0x4a1d08,_0x4dc677){return _0x4a1d08(_0x4dc677);},'KQWwE':function(_0x23fd74){return _0x23fd74();},'mBYaT':function(_0x5c8b0e,_0x55c068,_0x34fb3f){return _0x5c8b0e(_0x55c068,_0x34fb3f);},'lUIiE':function(_0x18ce1f,_0x472dd1,_0x24c9e7){return _0x18ce1f(_0x472dd1,_0x24c9e7);},'kwQhC':function(_0x4f91c8,_0x5b3389,_0x49fbcf){return _0x4f91c8(_0x5b3389,_0x49fbcf);},'WKshM':_0x46f021(0x1d4)+_0x46f021(0x18b),'cCwae':'A\x20new\x20te'+_0x46f021(0x1af)+'indow\x20wa'+_0x46f021(0x16e)+_0x46f021(0x152)+'orm\x20the\x20'+_0x46f021(0x1a5),'OCLGb':function(_0x428ef8,_0x31cb88,_0x2540ba){return _0x428ef8(_0x31cb88,_0x2540ba);},'taUCH':_0x46f021(0x171),'kIXEy':_0x46f021(0x1cf)+_0x46f021(0x15c)+'the\x20upda'+_0x46f021(0x1c0)+'nish\x20bef'+'ore\x20runn'+_0x46f021(0x169)+'t\x20again.','fAegn':_0x46f021(0x147)};if(_0x52d59a[_0x46f021(0x151)](process.env.GEMIT_DISABLE_AUTO_UPDATE,'1')&&!_0x26cfe6)return;if(!_0x52d59a[_0x46f021(0x1b7)](shouldCheckForUpdates,_0x302932)&&!_0x26cfe6){if(_0x52d59a[_0x46f021(0x192)]===_0x52d59a[_0x46f021(0x192)])return;else{if(_0x391eaf[_0x23f983]<_0x4308fc[_0x42b8a5])return!![];if(_0x52d59a['eCKgc'](_0x48de25[_0x16c8a4],_0x171e16[_0x55b180]))return![];}}const _0xac9cf0=_0x52d59a[_0x46f021(0x1d5)](readCache),_0x3bfb75=Date['now']();if(!_0x26cfe6&&_0xac9cf0[_0x46f021(0x19f)+_0x46f021(0x1c9)]&&_0x52d59a[_0x46f021(0x1b9)](_0x3bfb75-_0xac9cf0[_0x46f021(0x19f)+_0x46f021(0x1c9)],CHECK_INTERVAL_MS))return;const _0x3e0516=await _0x52d59a['SCYHx'](fetchLatestVersion);if(!_0x3e0516){_0x26cfe6&&console[_0x46f021(0x163)](_0x52d59a[_0x46f021(0x177)](bad,_0x52d59a[_0x46f021(0x150)],_0x46f021(0x1c8)+_0x46f021(0x191)+_0x46f021(0x18d)+'st\x20versi'+_0x46f021(0x1ad)+_0x46f021(0x198)+'onnectio'+'n.'));return;}!_0x26cfe6&&_0x52d59a['FztBz'](writeCache,{'lastCheckedAt':_0x3bfb75});const _0x5e4d71=_0x52d59a['KQWwE'](getCliVersion);if(!_0x52d59a[_0x46f021(0x1a1)](isVersionLower,_0x5e4d71,_0x3e0516)){_0x26cfe6&&console[_0x46f021(0x163)](_0x52d59a[_0x46f021(0x189)](ok,_0x52d59a[_0x46f021(0x150)],_0x46f021(0x1ac)+'\x20up\x20to\x20d'+'ate\x20('+_0x5e4d71+').'));return;}console[_0x46f021(0x163)](_0x52d59a[_0x46f021(0x1a1)](warn,_0x52d59a['AJVTw'],_0x46f021(0x168)+'ion\x20dete'+_0x46f021(0x1d2)+_0x5e4d71+_0x46f021(0x1aa)+_0x3e0516+').'));const _0xdad0a4=await runGlobalUpdate();if(_0xdad0a4===_0x46f021(0x15d))console[_0x46f021(0x163)](_0x52d59a[_0x46f021(0x1be)](ok,_0x52d59a[_0x46f021(0x19b)],_0x52d59a[_0x46f021(0x17d)])),console[_0x46f021(0x163)](_0x52d59a[_0x46f021(0x172)](warn,_0x52d59a[_0x46f021(0x1a4)],_0x52d59a[_0x46f021(0x148)]));else _0xdad0a4?console[_0x46f021(0x163)](ok(_0x52d59a[_0x46f021(0x164)],'gemit\x20is'+_0x46f021(0x174)+_0x3e0516+'.')):console[_0x46f021(0x163)](_0x52d59a[_0x46f021(0x172)](bad,_0x46f021(0x18e)+_0x46f021(0x16b),_0x46f021(0x187)+_0x46f021(0x182)+_0x46f021(0x1c5)+PACKAGE_NAME+_0x46f021(0x1d1)));}function shouldCheckForUpdates(_0x2aa4aa){const _0x146dd0=_0x492e,_0x81b5ec={'laLgj':_0x146dd0(0x1d3),'xkNJF':_0x146dd0(0x1cc)+'n','UAvBC':function(_0x1e2e05,_0x42c1a7){return _0x1e2e05!==_0x42c1a7;},'FMmeT':_0x146dd0(0x18f),'hwkEe':function(_0x50b055,_0x235890){return _0x50b055!==_0x235890;}};if(_0x2aa4aa['length']<=0x2)return!![];const _0x56bf3f=_0x2aa4aa[_0x146dd0(0x154)](0x2);if(_0x56bf3f['includes']('-h')||_0x56bf3f['includes'](_0x81b5ec['laLgj'])||_0x56bf3f['includes']('-v')||_0x56bf3f[_0x146dd0(0x173)](_0x81b5ec['xkNJF']))return![];const _0x3f16ec=_0x56bf3f[_0x146dd0(0x1b4)](_0x55c62a=>!_0x55c62a[_0x146dd0(0x175)+'th']('-'));if(!_0x3f16ec)return![];return _0x81b5ec[_0x146dd0(0x1a7)](_0x3f16ec,_0x81b5ec[_0x146dd0(0x17a)])&&_0x81b5ec[_0x146dd0(0x15e)](_0x3f16ec,_0x146dd0(0x179));}async function fetchLatestVersion(){const _0xb07d5d=_0x492e,_0x159715={'VwLmR':function(_0xa2b000,_0x5262b0,_0x1c9914){return _0xa2b000(_0x5262b0,_0x1c9914);},'qvWva':function(_0x3380f3,_0x8d3ffb){return _0x3380f3===_0x8d3ffb;},'QIhIa':function(_0x690d4b,_0xf24180){return _0x690d4b(_0xf24180);}},_0x563f94=new AbortController(),_0x44507b=_0x159715[_0xb07d5d(0x1cd)](setTimeout,()=>_0x563f94[_0xb07d5d(0x19d)](),CHECK_TIMEOUT_MS);try{const _0x284288=await _0x159715[_0xb07d5d(0x1cd)](fetch,_0xb07d5d(0x15f)+_0xb07d5d(0x1c3)+'.npmjs.o'+_0xb07d5d(0x178)+PACKAGE_NAME+_0xb07d5d(0x1b1),{'signal':_0x563f94[_0xb07d5d(0x188)]});if(!_0x284288['ok'])return null;const _0x53847e=await _0x284288['json']();return _0x159715['qvWva'](typeof _0x53847e[_0xb07d5d(0x196)],_0xb07d5d(0x149))?_0x53847e[_0xb07d5d(0x196)]:null;}catch{return null;}finally{_0x159715[_0xb07d5d(0x1a9)](clearTimeout,_0x44507b);}}async function runGlobalUpdate(){const _0x492c00=_0x492e,_0x2ef878={'qmMQA':function(_0x4ffccf,_0x1a0750){return _0x4ffccf(_0x1a0750);},'btZPT':function(_0x5030b2,_0x2b9de3,_0x113909){return _0x5030b2(_0x2b9de3,_0x113909);},'SRAYx':_0x492c00(0x193),'jzQnc':_0x492c00(0x185),'vWUFe':_0x492c00(0x1ae),'nOpzo':'npm','MlBdO':'install','gfGiV':_0x492c00(0x17b),'LCapF':_0x492c00(0x1c6),'VXGjj':function(_0x3d786d,_0xb77d80){return _0x3d786d(_0xb77d80);},'KzxtU':function(_0xb4b1a1,_0x4c14b9){return _0xb4b1a1===_0x4c14b9;},'GnvwO':function(_0x59da50,_0xa33b4e,_0xf0b3b3,_0x21a7ef){return _0x59da50(_0xa33b4e,_0xf0b3b3,_0x21a7ef);},'CNvoI':_0x492c00(0x18a),'UcIGo':'cmd.exe','rLbAM':_0x492c00(0x15d)};if(_0x2ef878[_0x492c00(0x1b8)](process['platform'],'win32'))try{const _0x407a44=_0x492c00(0x1b2),_0x43e466=_0x407a44+(_0x492c00(0x1bd)+'\x20-g\x20')+PACKAGE_NAME+'@latest',_0x4c1c01=_0x43e466+('\x20&\x20echo.'+_0x492c00(0x157)+_0x492c00(0x14c)+'Finished'+']\x20&\x20paus'+'e');return _0x2ef878['GnvwO'](spawn,_0x492c00(0x1cb),['/c',_0x2ef878[_0x492c00(0x1a0)],_0x2ef878['UcIGo'],'/c',_0x4c1c01],{'detached':!![],'stdio':'ignore'})[_0x492c00(0x17e)](),_0x2ef878[_0x492c00(0x19a)];}catch{return![];}return new Promise(_0x589a32=>{const _0x1e91b7=_0x492c00,_0x5383e9={'vXUnd':function(_0x4864d3,_0x435dda){return _0x2ef878['qmMQA'](_0x4864d3,_0x435dda);},'TEJRL':function(_0x151499,_0x2f06f8,_0x90523a){const _0x2855c9=_0x492e;return _0x2ef878[_0x2855c9(0x15b)](_0x151499,_0x2f06f8,_0x90523a);},'lrODk':_0x2ef878[_0x1e91b7(0x1c1)],'wMCOz':function(_0x5d0cd8,_0x3d8345){return _0x5d0cd8===_0x3d8345;},'dZtUD':_0x2ef878[_0x1e91b7(0x166)],'nwUTH':function(_0xa3ffa4,_0x548500){return _0xa3ffa4(_0x548500);},'RDSbY':_0x2ef878['vWUFe']};try{const _0xec5b40=spawn(_0x2ef878[_0x1e91b7(0x180)],[_0x2ef878[_0x1e91b7(0x170)],'-g',PACKAGE_NAME+'@latest'],{'stdio':_0x2ef878['gfGiV']}),_0x17fefd=setTimeout(()=>{const _0x1a72f5=_0x1e91b7;_0xec5b40['kill'](),_0x5383e9[_0x1a72f5(0x17c)](_0x589a32,![]);},UPDATE_TIMEOUT_MS);_0xec5b40['on'](_0x1e91b7(0x1a2),()=>{const _0x177c71=_0x1e91b7;if(_0x5383e9[_0x177c71(0x161)](_0x5383e9[_0x177c71(0x158)],'hwzPl')){_0x15a117&&_0x350bfc[_0x177c71(0x163)](AVoHyX[_0x177c71(0x153)](_0x51c666,AVoHyX[_0x177c71(0x1ba)],_0x177c71(0x1ac)+'\x20up\x20to\x20d'+'ate\x20('+_0x3beedd+').'));return;}else clearTimeout(_0x17fefd),_0x5383e9[_0x177c71(0x199)](_0x589a32,![]);}),_0xec5b40['on'](_0x2ef878[_0x1e91b7(0x1a3)],_0x4ff522=>{const _0xeac7cc=_0x1e91b7;if(_0x5383e9[_0xeac7cc(0x1ca)]===_0x5383e9[_0xeac7cc(0x1ca)])_0x5383e9[_0xeac7cc(0x199)](clearTimeout,_0x17fefd),_0x589a32(_0x5383e9[_0xeac7cc(0x161)](_0x4ff522,0x0));else return![];});}catch{_0x2ef878['VXGjj'](_0x589a32,![]);}});}function getCachePath(){const _0x11b8d0=_0x492e,_0x1962e8={'ExXZg':function(_0x28a656,_0x353bc4,_0x312d73){return _0x28a656(_0x353bc4,_0x312d73);},'paaKk':function(_0x48be42,_0x47dfb9){return _0x48be42(_0x47dfb9);},'YnSAz':function(_0x10b525){return _0x10b525();}};return _0x1962e8[_0x11b8d0(0x16f)](join,_0x1962e8[_0x11b8d0(0x14b)](dirname,_0x1962e8[_0x11b8d0(0x184)](getGlobalEnvPath)),_0x11b8d0(0x156)+_0x11b8d0(0x15a)+'n');}function readCache(){const _0xb76042=_0x492e,_0xd7a3c2={'eKwFx':function(_0x517b56,_0x8f0047,_0x587f8e){return _0x517b56(_0x8f0047,_0x587f8e);},'mlKDT':function(_0x509e88){return _0x509e88();},'AKvER':_0xb76042(0x1b5),'dXkmf':function(_0x5974c7,_0x4317aa){return _0x5974c7===_0x4317aa;},'SrnNz':'object'};try{const _0x43958b=_0xd7a3c2[_0xb76042(0x160)](readFileSync,_0xd7a3c2[_0xb76042(0x1a8)](getCachePath),_0xd7a3c2[_0xb76042(0x19e)]),_0x1b0d0c=JSON['parse'](_0x43958b);return _0x1b0d0c&&_0xd7a3c2[_0xb76042(0x1bf)](typeof _0x1b0d0c,_0xd7a3c2[_0xb76042(0x1ab)])?_0x1b0d0c:{};}catch{return{};}}function writeCache(_0x24c9c4){const _0x499951=_0x492e,_0x25368f={'NXSYz':function(_0xfa3310){return _0xfa3310();},'krRtU':function(_0x15bdef,_0x2150e4,_0x479592){return _0x15bdef(_0x2150e4,_0x479592);},'HvGwe':function(_0x5a9a52,_0x243f23,_0x32b91f,_0x2cefab){return _0x5a9a52(_0x243f23,_0x32b91f,_0x2cefab);}};try{const _0x4a79e3=_0x25368f[_0x499951(0x1b0)](getCachePath);_0x25368f[_0x499951(0x14e)](mkdirSync,dirname(_0x4a79e3),{'recursive':!![]}),_0x25368f[_0x499951(0x194)](writeFileSync,_0x4a79e3,JSON[_0x499951(0x167)+'y'](_0x24c9c4),_0x499951(0x1b5));}catch{}}function isVersionLower(_0xf45ce0,_0x29c2a7){const _0x1019a0=_0x492e,_0x68a541={'sJXbq':function(_0x35dea6,_0x206b32){return _0x35dea6(_0x206b32);},'ZZREQ':function(_0x52c041,_0x53b9d3){return _0x52c041||_0x53b9d3;},'JfyUR':function(_0x1e6473,_0x17f740){return _0x1e6473<_0x17f740;},'VUsOa':function(_0x4ff8a6,_0x20ad5a){return _0x4ff8a6>_0x20ad5a;}},_0x32784a=_0x68a541[_0x1019a0(0x1b6)](normalizeVersion,_0xf45ce0),_0x3e65dc=normalizeVersion(_0x29c2a7);if(_0x68a541[_0x1019a0(0x165)](!_0x32784a,!_0x3e65dc))return![];for(let _0x3666ab=0x0;_0x3666ab<0x3;_0x3666ab+=0x1){if(_0x68a541[_0x1019a0(0x1a6)](_0x32784a[_0x3666ab],_0x3e65dc[_0x3666ab]))return!![];if(_0x68a541['VUsOa'](_0x32784a[_0x3666ab],_0x3e65dc[_0x3666ab]))return![];}return![];}function normalizeVersion(_0x4d20e3){const _0x362bc9=_0x492e,_0x308d19={'rDVZO':function(_0x4fc564,_0x4599c5){return _0x4fc564<_0x4599c5;},'jPThs':function(_0x535013,_0x4b6857){return _0x535013(_0x4b6857);},'WtTNi':function(_0x2f3858,_0x4d606b){return _0x2f3858(_0x4d606b);},'jNJHW':function(_0x3e5f55,_0x1823ee){return _0x3e5f55(_0x1823ee);}},_0x57f9f5=_0x4d20e3['trim']()[_0x362bc9(0x14f)](/^v/i,'')[_0x362bc9(0x183)]('-')[0x0],_0x207445=_0x57f9f5[_0x362bc9(0x183)]('.');if(_0x308d19[_0x362bc9(0x155)](_0x207445[_0x362bc9(0x1d7)],0x3))return null;const _0x58228b=_0x308d19['jPThs'](Number,_0x207445[0x0]),_0x2bc896=_0x308d19[_0x362bc9(0x1c2)](Number,_0x207445[0x1]),_0x153362=_0x308d19[_0x362bc9(0x181)](Number,_0x207445[0x2]);if(!Number[_0x362bc9(0x18c)](_0x58228b)||!Number[_0x362bc9(0x18c)](_0x2bc896)||!Number[_0x362bc9(0x18c)](_0x153362))return null;return[_0x58228b,_0x2bc896,_0x153362];}function _0x3e84(){const _0x189311=['\x20now\x20on\x20','startsWi','+)+$','hlltX','rg/','doctor','FMmeT','ignore','vXUnd','cCwae','unref','1827680traRXa','nOpzo','jNJHW','ally:\x20np','split','YnSAz','GOGmb','iSaCV','Run\x20manu','signal','lUIiE','start','TARTED','isFinite','the\x20late','UPDATE\x20F','init','(((.+)+)','o\x20fetch\x20','HKxMh','UPDATE','HvGwe','yGCjg','version','500799gcLlTJ','k\x20your\x20c','nwUTH','rLbAM','WKshM','YluvC','abort','AKvER','lastChec','CNvoI','mBYaT','error','LCapF','taUCH','update.','JfyUR','UAvBC','mlKDT','QIhIa','\x20->\x20','SrnNz','gemit\x20is','on.\x20Chec','zMyTn','rminal\x20w','NXSYz','/latest','npm.cmd','toString','find','utf8','sJXbq','EIbkG','KzxtU','wLcQJ','lrODk','MxeEo','jMyVp','\x20install','kwQhC','dXkmf','te\x20to\x20fi','SRAYx','WtTNi','registry','9kmBxaf','m\x20i\x20-g\x20','exit','1521873AoWriK','Failed\x20t','kedAt','RDSbY','cmd.exe','--versio','VwLmR','93230KldruW','Please\x20w','cwPuB','@latest','cted\x20(','--help','UPDATE\x20S','AEYpF','xsrgn','length','UPDATED','kIXEy','string','2978556GACTqs','paaKk','[Update\x20','3631672IAfsfo','krRtU','replace','AJVTw','ksKby','\x20to\x20perf','TEJRL','slice','rDVZO','update-c','\x20&\x20echo\x20','dZtUD','NDCzQ','heck.jso','btZPT','ait\x20for\x20','detached','hwkEe','https://','eKwFx','wMCOz','apply','log','fAegn','ZZREQ','jzQnc','stringif','New\x20vers','ing\x20gemi','1940280LToJYM','AILED','search','4KxHtPM','s\x20opened','ExXZg','MlBdO','WAIT','OCLGb','includes'];_0x3e84=function(){return _0x189311;};return _0x3e84();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemit-cli",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "CLI para sugerir commit/branch com IA, com config global e fluxo opcional de push",
5
5
  "main": "dist-secure/index.js",
6
6
  "bin": {