From 1d6adaf5ad53b06a2597becb759fddf344865602 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Mon, 6 Jun 2022 13:54:22 +0200 Subject: [PATCH] hotfix: try to fix `maestro bootstrap` on Windows --- AutomatorServer/app/build.gradle | 2 +- packages/maestro_cli/CHANGELOG.md | 5 ++- .../lib/src/commands/bootstrap_command.dart | 35 ++++++++++--------- packages/maestro_cli/pubspec.yaml | 2 +- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/AutomatorServer/app/build.gradle b/AutomatorServer/app/build.gradle index a1664b08d..fb67abc91 100644 --- a/AutomatorServer/app/build.gradle +++ b/AutomatorServer/app/build.gradle @@ -13,7 +13,7 @@ android { minSdkVersion 26 targetSdkVersion 32 versionCode 1 - versionName "0.0.5" + versionName "0.0.6" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/packages/maestro_cli/CHANGELOG.md b/packages/maestro_cli/CHANGELOG.md index d31b3ab45..7ec833314 100644 --- a/packages/maestro_cli/CHANGELOG.md +++ b/packages/maestro_cli/CHANGELOG.md @@ -1,8 +1,11 @@ +## 0.0.6 + +- Fix `maestro bootstrap` on Windows crashing with ProcessException + ## 0.0.5 - Make versions match AutomatorServer - ## 0.0.4 - Nothing diff --git a/packages/maestro_cli/lib/src/commands/bootstrap_command.dart b/packages/maestro_cli/lib/src/commands/bootstrap_command.dart index 2326933dc..a4715c242 100644 --- a/packages/maestro_cli/lib/src/commands/bootstrap_command.dart +++ b/packages/maestro_cli/lib/src/commands/bootstrap_command.dart @@ -54,6 +54,24 @@ Future _createConfigFile() async { progress.complete('Created default $configFileName'); } +Future _addMaestroToPubspec() async { + final progress = log.progress('Adding $maestroPackage to dev_dependencies'); + + final result = await Process.run( + 'flutter', + ['pub', 'add', maestroPackage, '--dev'], + runInShell: true, + ); + + if (result.exitCode != 0) { + progress.fail('Failed to add $maestroPackage to dev_dependencies'); + log.severe(result.stderr); + return; + } + + progress.complete('Added $maestroPackage to dev_dependencies'); +} + Future _createDefaultTestDriverFile() async { final relativeFilePath = path.join(driverDirName, driverFileName); @@ -101,20 +119,3 @@ Future _createDefaultIntegrationTestFile() async { progress.complete('Created default $relativeFilePath'); } - -Future _addMaestroToPubspec() async { - final progress = log.progress('Adding $maestroPackage to dev_dependencies'); - - final result = await Process.run( - 'flutter', - ['pub', 'add', maestroPackage, '--dev'], - ); - - if (result.exitCode != 0) { - progress.fail('Failed to add $maestroPackage to dev_dependencies'); - log.severe(result.stderr); - return; - } - - progress.complete('Added $maestroPackage to dev_dependencies'); -} diff --git a/packages/maestro_cli/pubspec.yaml b/packages/maestro_cli/pubspec.yaml index 7ed4f7e7f..ca729bdf8 100644 --- a/packages/maestro_cli/pubspec.yaml +++ b/packages/maestro_cli/pubspec.yaml @@ -1,6 +1,6 @@ name: maestro_cli description: CLI for Maestro. -version: 0.0.5 +version: 0.0.6 homepage: https://github.com/leancodepl/maestro environment: