mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at new-image-api 34 lines 1.0 kB view raw
1const exec = require('child_process').execSync 2 3const SENTRY_AUTH_TOKEN = process.env.SENTRY_AUTH_TOKEN 4 5module.exports = ({config}) => { 6 if (!SENTRY_AUTH_TOKEN) { 7 console.log( 8 'SENTRY_AUTH_TOKEN environment variable must be set to upload sourcemaps. Skipping.', 9 ) 10 return 11 } 12 13 const org = config.organization 14 const project = config.project 15 const release = config.release 16 const dist = config.dist 17 18 if (!org || !project || !release || !dist) { 19 console.log( 20 '"organization", "project", "release", and "dist" must be set in the hook config to upload sourcemaps. Skipping.', 21 ) 22 return 23 } 24 25 try { 26 console.log('Uploading sourcemaps to Sentry...') 27 exec( 28 `node node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps dist --url https://sentry.io/ -o ${org} -p ${project} -r ${release} -d ${dist}`, 29 ) 30 console.log('Sourcemaps uploaded to Sentry.') 31 } catch (e) { 32 console.error('Error uploading sourcemaps to Sentry:', e) 33 } 34}