this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't link to github if fake commit hash

+16 -11
+13 -11
src/pages/settings.jsx
··· 576 576 } 577 577 }} 578 578 />{' '} 579 - <span class="ib insignificant"> 580 - ( 581 - <a 582 - href={`https://github.com/cheeaun/phanpy/commit/${__COMMIT_HASH__}`} 583 - target="_blank" 584 - rel="noopener noreferrer" 585 - > 586 - <RelativeTime datetime={new Date(__BUILD_TIME__)} /> 587 - </a> 588 - ) 589 - </span> 579 + {!__FAKE_COMMIT_HASH__ && ( 580 + <span class="ib insignificant"> 581 + ( 582 + <a 583 + href={`https://github.com/cheeaun/phanpy/commit/${__COMMIT_HASH__}`} 584 + target="_blank" 585 + rel="noopener noreferrer" 586 + > 587 + <RelativeTime datetime={new Date(__BUILD_TIME__)} /> 588 + </a> 589 + ) 590 + </span> 591 + )} 590 592 </p> 591 593 )} 592 594 </section>
+3
vite.config.js
··· 17 17 18 18 const now = new Date(); 19 19 let commitHash; 20 + let fakeCommitHash = false; 20 21 try { 21 22 commitHash = execSync('git rev-parse --short HEAD').toString().trim(); 22 23 } catch (error) { 23 24 // If error, means git is not installed or not a git repo (could be downloaded instead of git cloned) 24 25 // Fallback to random hash which should be different on every build run 🤞 25 26 commitHash = uid(); 27 + fakeCommitHash = true; 26 28 } 27 29 28 30 const rollbarCode = fs.readFileSync( ··· 38 40 define: { 39 41 __BUILD_TIME__: JSON.stringify(now), 40 42 __COMMIT_HASH__: JSON.stringify(commitHash), 43 + __FAKE_COMMIT_HASH__: fakeCommitHash, 41 44 }, 42 45 server: { 43 46 host: true,