-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsourcemap_single_file.dart
More file actions
46 lines (40 loc) · 958 Bytes
/
sourcemap_single_file.dart
File metadata and controls
46 lines (40 loc) · 958 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
40
41
42
43
44
45
46
import 'dart:io';
import 'package:raygun_cli/sourcemap/sourcemap_api.dart';
import 'package:raygun_cli/sourcemap/sourcemap_base.dart';
class SourcemapSingleFile extends SourcemapBase {
SourcemapSingleFile({
required super.command,
required super.verbose,
required super.config,
});
@override
Future<void> upload() async {
if (!command.wasParsed('uri')) {
print('Missing "uri"');
exit(2);
}
final uri = command.option('uri')!;
if (!command.wasParsed('input-map')) {
print('Missing "input-map"');
exit(2);
}
final path = command.option('input-map')!;
if (verbose) {
print('app-id: $appId');
print('token: $token');
print('input-map: $path');
print('uri: $uri');
}
final out = await uploadSourcemap(
appId: appId,
token: token,
path: path,
uri: uri,
);
if (out) {
exit(0);
} else {
exit(2);
}
}
}