2024-09-07 14:42:32 -06:00
|
|
|
import 'dart:async';
|
2024-09-10 15:09:15 -06:00
|
|
|
import 'dart:developer' as dev;
|
2024-09-07 14:42:32 -06:00
|
|
|
import 'dart:io';
|
|
|
|
|
2024-09-10 15:09:15 -06:00
|
|
|
import 'package:dartboard_resume/dartboard_runner.dart';
|
2024-09-07 14:42:32 -06:00
|
|
|
import 'package:hotreloader/hotreloader.dart';
|
|
|
|
import 'package:logging/logging.dart' as logging;
|
|
|
|
|
|
|
|
Future<void> main(List<String> arguments) async {
|
|
|
|
logging.hierarchicalLoggingEnabled = true;
|
|
|
|
HotReloader.logLevel = logging.Level.INFO;
|
2024-09-10 15:09:15 -06:00
|
|
|
HotReloader? reloader;
|
|
|
|
if ((await dev.Service.getInfo()).serverUri != null) {
|
|
|
|
reloader = await HotReloader.create();
|
2024-09-07 14:42:32 -06:00
|
|
|
} else {
|
2024-09-10 15:09:15 -06:00
|
|
|
stdout.writeln(
|
|
|
|
"Dartboard can hot reload if run with dart's VM service.\n`dart run --enable-vm-service bin/dartboard_resume.dart`",
|
|
|
|
);
|
2024-09-07 14:42:32 -06:00
|
|
|
}
|
2024-09-10 15:09:15 -06:00
|
|
|
dartboardRun(reloader);
|
2024-09-07 14:42:32 -06:00
|
|
|
}
|