sentry.js 497 B

123456789101112131415161718
  1. const {
  2. getAppEnv,
  3. ENV_DEVELOPMENT,
  4. isDisableSentryFlagSet,
  5. } = require('../env.js');
  6. const cp = require('child_process');
  7. module.exports.getIsSentryEnabled = () => {
  8. const isAppENVDevelopment = getAppEnv() === ENV_DEVELOPMENT;
  9. const isSentryDisabled = isDisableSentryFlagSet();
  10. return !isAppENVDevelopment || !isSentryDisabled;
  11. };
  12. module.exports.getGitSha = () =>
  13. cp.execSync('git rev-parse --short HEAD', {
  14. cwd: __dirname,
  15. encoding: 'utf8',
  16. });