-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsourcemap_single_file.dart
More file actions
49 lines (42 loc) · 1.05 KB
/
sourcemap_single_file.dart
File metadata and controls
49 lines (42 loc) · 1.05 KB
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
47
48
49
import 'dart:io';
import 'package:raygun_cli/config_props.dart';
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,
});
@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')!;
final appId = ConfigProp.appId.load(command);
final token = ConfigProp.token.load(command);
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);
}
}
}