2021-09-23 19:25:03 +02:00
|
|
|
// ignore_for_file: avoid_print
|
2021-02-28 16:40:58 +01:00
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
void confirm(String message) {
|
|
|
|
stdout.write('$message [y/n] ');
|
|
|
|
|
|
|
|
switch (stdin.readLineSync()) {
|
|
|
|
case 'y':
|
|
|
|
case 'yes':
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
print('Exiting');
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-09 11:41:11 +02:00
|
|
|
Never printError(String message) {
|
2021-02-28 16:40:58 +01:00
|
|
|
stderr.writeln('\x1B[31m$message\x1B[0m');
|
|
|
|
|
2021-04-09 11:41:11 +02:00
|
|
|
exit(1);
|
2021-02-28 16:40:58 +01:00
|
|
|
}
|