289546cf63e3b13c0b2b06d20728f365538250cb
[motion-next.git] / server / utils / build-info.js
1 const a1231_0x4511=['undefined','xcally','../config/config.service','join','isProduction','../../package.json','git-last-commit'];(function(_0x4b444e,_0x451182){const _0x26c1ce=function(_0x2a209b){while(--_0x2a209b){_0x4b444e['push'](_0x4b444e['shift']());}};_0x26c1ce(++_0x451182);}(a1231_0x4511,0x15b));const a1231_0x26c1=function(_0x4b444e,_0x451182){_0x4b444e=_0x4b444e-0x0;let _0x26c1ce=a1231_0x4511[_0x4b444e];return _0x26c1ce;};const _0x16921a=a1231_0x26c1,{getLastCommit}=require(_0x16921a('0x2')),{getConfigService}=require(_0x16921a('0x5')),packageJson=require(_0x16921a('0x1')),cs=getConfigService();function getBuildInfo(){return new Promise((_0x2a209b,_0x1cd531)=>{getLastCommit(function(_0x31b99a,_0xaf667b){const _0x1c8668=a1231_0x26c1;if(_0x31b99a)_0x1cd531(_0x31b99a);else{const {shortHash:_0x35c86b,branch:_0x26dce9,committedOn:_0x3c54f0,tags:_0xc741c4}=_0xaf667b;_0x2a209b({'shortHash':_0x35c86b,'branch':_0x26dce9,'tag':_0xc741c4[_0x1c8668('0x6')](',\x20'),'committedOn':new Date(Number(_0x3c54f0)*0x3e8),'buildDate':new Date()});}});});}function readBuildInfo(){const _0x39f504=_0x16921a;return cs[_0x39f504('0x0')]&&typeof packageJson[_0x39f504('0x4')]!==_0x39f504('0x3')?Promise['resolve'](packageJson['xcally']):getBuildInfo();}module['exports']={'getBuildInfo':getBuildInfo,'readBuildInfo':readBuildInfo};