11#!/usr/bin/env node
2+ /* eslint-disable no-console */
23const yargs = require ( 'yargs' ) ;
34
45const { createRelease } = require ( './createRelease' ) ;
6+ const { injectDebugId } = require ( './injectDebugId' ) ;
57
68const DEFAULT_URL_PREFIX = '~/build/' ;
79const DEFAULT_BUILD_PATH = 'public/build' ;
@@ -24,16 +26,35 @@ const argv = yargs(process.argv.slice(2))
2426 describe : 'The path to the build directory' ,
2527 default : DEFAULT_BUILD_PATH ,
2628 } )
29+ . option ( 'disableDebugIds' , {
30+ type : 'boolean' ,
31+ describe : 'Disable the injection and upload of debug ids' ,
32+ default : false ,
33+ } )
34+ . option ( 'deleteAfterUpload' , {
35+ type : 'boolean' ,
36+ describe : 'Delete sourcemaps after uploading' ,
37+ default : true ,
38+ } )
2739 . usage (
2840 'Usage: $0\n' +
2941 ' [--release RELEASE]\n' +
3042 ' [--urlPrefix URL_PREFIX]\n' +
3143 ' [--buildPath BUILD_PATH]\n\n' +
44+ ' [--disableDebugIds true|false]\n\n' +
45+ ' [--deleteAfterUpload true|false]\n\n' +
3246 'This CLI tool will upload sourcemaps to Sentry for the given release.\n' +
3347 'It has defaults for URL prefix and build path for Remix builds, but you can override them.\n\n' +
3448 'If you need a more advanced configuration, you can use `sentry-cli` instead.\n' +
3549 'https://github.com/getsentry/sentry-cli' ,
3650 )
3751 . wrap ( 120 ) . argv ;
3852
39- createRelease ( argv , DEFAULT_URL_PREFIX , DEFAULT_BUILD_PATH ) ;
53+ const buildPath = argv . buildPath || DEFAULT_BUILD_PATH ;
54+ const urlPrefix = argv . urlPrefix || DEFAULT_URL_PREFIX ;
55+
56+ if ( ! argv . disableDebugIds ) {
57+ injectDebugId ( buildPath ) ;
58+ }
59+
60+ createRelease ( argv , urlPrefix , buildPath ) ;
0 commit comments