-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathsentryscript.js
More file actions
39 lines (33 loc) · 840 Bytes
/
sentryscript.js
File metadata and controls
39 lines (33 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const execFileSync = require('child_process').execFileSync;
const parse = require('shell-quote/parse');
if (process.argv.length === 2) {
console.error('Version argument is missing.');
process.exit(1);
}
const sourcemaps = execFileSync('find', [
'./dist',
'-name',
'*.js.map',
]).toString();
if (!sourcemaps.length) {
console.error('Source maps are missing.');
process.exit(1);
}
const version = process.argv[2];
const commands = [
{ cmd: 'sentry-cli', args: ['sourcemaps', 'inject', './dist'] },
{
cmd: 'sentry-cli',
args: parse('sourcemaps upload --release="$VERSION" ./dist', {
VERSION: version,
}),
},
{
cmd: 'find',
args: ['./dist', '-name', '*.js.map', '-delete'],
},
];
for (const { cmd, args } of commands) {
execFileSync(cmd, args, { stdio: 'inherit' });
}
process.exit(0);