lemmur-app-android/scripts/common.dart

21 lines
357 B
Dart
Raw Normal View History

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-03-01 09:55:30 +01:00
void printError(String message, {bool shouldExit = true}) {
stderr.writeln('\x1B[31m$message\x1B[0m');
if (shouldExit) exit(1);
}