Skip to content

Commit 9d87ae7

Browse files
committed
Use proposeVersion if release is not provided.
1 parent b96cc52 commit 9d87ae7

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

packages/remix/scripts/upload-sourcemaps.js

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
#! /usr/bin/env node
2-
/* eslint-disable no-console */
32
const SentryCli = require('@sentry/cli');
43
const argv = require('yargs/yargs')(process.argv.slice(2))
5-
.option('release', { type: 'string', describe: 'The release number', demandOption: true })
4+
.option('release', { type: 'string', describe: 'The release number' })
65
.option('urlPrefix', { type: 'string', describe: 'The url prefix for the sourcemaps' })
76
.option('buildPath', { type: 'string', describe: 'The path to the build directory' })
8-
.usage('Usage: $0 --release RELEASE [--urlPrefix URL_PREFIX] [--buildPath BUILD_PATH]').argv;
9-
10-
const RELEASE = argv.release;
11-
12-
if (!RELEASE) {
13-
console.error('No release provided.');
14-
process.exit(1);
15-
}
16-
17-
const URL_PREFIX = argv.urlPrefix || '~/build/';
18-
const BUILD_PATH = argv.buildPath || 'public/build';
7+
.usage(
8+
'Usage: $0 [--release RELEASE] [--urlPrefix URL_PREFIX] [--buildPath BUILD_PATH] \n\n' +
9+
'If you need a more advanced configuration, you can use `sentry-cli` instead.\n' +
10+
'https://github.com/getsentry/sentry-cli',
11+
).argv;
1912

2013
const sentry = new SentryCli();
2114

2215
async function createRelease() {
16+
const RELEASE = argv.release || (await sentry.releases.proposeVersion());
17+
const URL_PREFIX = argv.urlPrefix || '~/build/';
18+
const BUILD_PATH = argv.buildPath || 'public/build';
19+
2320
await sentry.releases.new(RELEASE);
2421

2522
await sentry.releases.uploadSourceMaps(RELEASE, {

0 commit comments

Comments
 (0)