Add Wyatt Continuous Deployment as Sub package #236
@ -5,3 +5,4 @@
|
|||||||
# Avoid committing pubspec.lock for library packages; see
|
# Avoid committing pubspec.lock for library packages; see
|
||||||
# https://dart.dev/guides/libraries/private-files#pubspeclock.
|
# https://dart.dev/guides/libraries/private-files#pubspeclock.
|
||||||
pubspec.lock
|
pubspec.lock
|
||||||
|
!bin/
|
@ -0,0 +1,20 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:mason_logger/mason_logger.dart';
|
||||||
|
import 'package:wyatt_continuous_deployment/src/bootstrap.dart';
|
||||||
|
import 'package:wyatt_continuous_deployment/src/wyatt_continuous_deployment_command_runner.dart';
|
||||||
|
|
||||||
|
Future<void> main(List<String> args) async {
|
||||||
|
await bootstrap(Logger());
|
||||||
|
await flushThenExit(await WyattContinuousDeploymentCommandRunner().run(args));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Flushes the stdout and stderr streams, then exits the program with the given
|
||||||
|
/// status code.
|
||||||
|
///
|
||||||
|
/// This returns a Future that will never complete, since the program will have
|
||||||
|
/// exited already. This is useful to prevent Future chains from proceeding
|
||||||
|
/// after you've decided to exit.
|
||||||
|
Future<dynamic> flushThenExit(int status) =>
|
||||||
|
Future.wait<void>([stdout.close(), stderr.close()])
|
||||||
|
.then<void>((_) => exit(status));
|
Loading…
x
Reference in New Issue
Block a user