1
0
mirror of https://github.com/krawieck/lemmur/ synced 2024-12-23 06:25:29 +01:00
lemmur-app-android/scripts/common.dart
2021-03-01 09:55:30 +01:00

21 lines
357 B
Dart

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