<img width="684" alt="image" src="https://github.com/flutter/engine/assets/919017/2dcdc7e9-b0e1-434d-9078-1de6a3d57d35">
This commit is contained in:
Brandon DeRosier 2024-05-01 18:36:30 -07:00 committed by GitHub
parent 829ae71a50
commit dfed7164a1
3 changed files with 73 additions and 0 deletions

View File

@ -14,8 +14,13 @@ import 'package:process_runner/process_runner.dart';
import 'src/commands/command_runner.dart';
import 'src/environment.dart';
import 'src/logger.dart';
import 'src/phone_home.dart';
void main(List<String> args) async {
if (phoneHome(args)) {
return;
}
final bool verbose = args.contains('--verbose') || args.contains('-v');
final bool help = args.contains('help') || args.contains('--help') ||
args.contains('-h');

View File

@ -0,0 +1,49 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Returns true if et successfully phoned home.
bool phoneHome(List<String> args) {
if (args.length != 2 ||
args[0].toLowerCase() != 'phone' ||
args[1].toLowerCase() != 'home') {
return false;
}
print(r'''
.. .. .. ...... :::::::.
.:---:.::-=-:::::::::::-=- .-....:----===.
--:-==++=-==++*=-- ....:-:--==*+=------+++==+*+
.-::-=++*######****#+++==-.:---=-++-+:-:===+*=+%@@:
.:--==*****++++=++++**#%#***=:=+=-+++++***+*#*%@@@@@*
.--==++++++=++***##*+==+*++****++++--=+++*#%%@@@%##%%%.
-----=*++=-+*####**##%##++===---:::-==+**++*+*###%@@@@@#
. ..:===++++==**###*#%* -*##%#*++===:::==+*****#+##%@@@@@@@@
::---====++=-+*##+-###=-+ .*#*#***+++++++==++++++*%@@%-.*@@@.
-==-====+++=-=+#*=-%%%%@*. :***+=+=+*#%##%%%#**#@%%@@%=-*@@%-
==========--=++*#*##*##**++**++==++**#%%@@@%@@@%%%###%%%%%%##:
-====++--=+=-+*********#**+=*+**+###**###*###%%#%%##**######.
.=++++==+****+++**++*+==*#++*#*#**+**+****#%%#%%%#%%%@@@=
:==++*+****************##*+***#*#********#%%#%%%%%%#-
====++*****#*##*##**#**++##***##**##***#####%%%%*
=+=++++*#****#######*+**##**********###%%%%@@@%
=+++*+*##*****####*##%@@@@%%####*###%%%##%@#%
=+++*+*##%%##%%%%%@%@%**##%%#%%####%@@@@@@%-
:++++***###%%%%%%%%@@@@@@@@@@@@@@@@@@@%+: =***#%%#*+=--=:
.++++***##%%%@@@@@%+ :+*##%#%%%#+ -+**#**#%%@@@@%*=----
:==++++**#%%%%%%%%% -*+****#%@%=
-++++++*#%%%@@@@%: +=-+*#@#.
.====+**+*#######%# -==:--**
:=====++*#%%%%%%%+ =++==++**+:
---=+**++*******#+ =**+=++***+**##*
:-=====++**#####* +**+*+=+*+**##*+***+.
-====++**++****** -+====-+**#*: =%%##**#=
-++++***######### :++==**##*#- -#@@@@@%**#=
.---+****###%%%%%#*. .+=++*##**%%%%%@@@@@% *#*#*
. ..:::-=+**##*##%###****--+===+*##*+*%@@%#%# ***#
...::::: . .--====+***#########**=====++***#%%%######*: =@%=
....::::.:----::::-----=++**********##==-=++**##%*+*#%###****
.::::::::------=-::::--====+=++++++++:-=-=+**#*##*%%###*#*#***
:-: ....:-===---------:---===++****- :-=-+****##@@@%%%%##***#*+''');
return true;
}

View File

@ -0,0 +1,19 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:engine_tool/src/phone_home.dart';
import 'package:litetest/litetest.dart';
void main() {
test('can et phone home', () async {
final bool emptyResult = phoneHome(List<String>.empty());
expect(emptyResult, isFalse);
final bool buildResult = phoneHome(<String>['build']);
expect(buildResult, isFalse);
final bool phoneHomeResult = phoneHome(<String>['Phone', 'Home']);
expect(phoneHomeResult, isTrue);
});
}