-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproguard.dart
More file actions
64 lines (54 loc) · 1.59 KB
/
proguard.dart
File metadata and controls
64 lines (54 loc) · 1.59 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import 'dart:io';
import 'package:raygun_cli/proguard/proguard_api.dart';
import 'package:args/args.dart';
import '../config_props.dart';
class Proguard {
final ArgResults command;
final bool verbose;
Proguard({
required this.command,
required this.verbose,
});
Future<void> upload() async {
if (!command.wasParsed('path')) {
print('Error: Missing "--path"');
print(' Please provide "--path" via argument');
exit(2);
}
if (!command.wasParsed('version')) {
print('Error: Missing "--version"');
print(' Please provide "--version" via argument');
exit(2);
}
if (!command.wasParsed('external-access-token')) {
print('Error: Missing "--external-access-token"');
print(' Please provide "--external-access-token" via argument');
exit(2);
}
final externalAccessToken =
command.option('external-access-token') as String;
final path = command.option('path') as String;
final version = command.option('version') as String;
final overwrite = command.wasParsed('overwrite');
final appId = ConfigProp.appId.load(command);
if (verbose) {
print('app-id: $appId');
print('external-access-token: $externalAccessToken');
print('path: $path');
print('version: $version');
print('overwrite: $overwrite');
}
final success = await uploadProguardMapping(
appId: appId,
externalAccessToken: externalAccessToken,
path: path,
version: version,
overwrite: overwrite,
);
if (success) {
exit(0);
} else {
exit(2);
}
}
}