diff --git a/mono_repo/CHANGELOG.md b/mono_repo/CHANGELOG.md index cccfe14c..14744213 100644 --- a/mono_repo/CHANGELOG.md +++ b/mono_repo/CHANGELOG.md @@ -1,6 +1,8 @@ ## 6.6.1 - Update to latest action versions. +- Remove usage of removed `flutter format` command in + the generated `tool/ci.sh` file. ## 6.6.0 diff --git a/mono_repo/lib/src/ci_test_script.dart b/mono_repo/lib/src/ci_test_script.dart index d87c078b..80995049 100644 --- a/mono_repo/lib/src/ci_test_script.dart +++ b/mono_repo/lib/src/ci_test_script.dart @@ -7,9 +7,19 @@ import 'package_config.dart'; import 'shell_utils.dart'; import 'user_exception.dart'; -String _commandContent(String commandName) => ''' +String _commandContent(String commandName, {bool dartOnly = false}) { + if (dartOnly) { + return ''' + +function $commandName() { + command dart $commandName "\$@" +}'''; + } + + return ''' + # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". +# then "flutter $commandName" is called instead of "dart $commandName". # This assumes that the Flutter SDK has been installed in a previous step. function $commandName() { if grep -Fq "sdk: flutter" "\${PWD}/pubspec.yaml"; then @@ -18,6 +28,7 @@ function $commandName() { command dart $commandName "\$@" fi }'''; +} final bashScriptHeader = ''' #!/bin/bash @@ -25,7 +36,7 @@ $createdWith # Support built in commands on windows out of the box. ${_commandContent('pub')} -${_commandContent('format')} +${_commandContent('format', dartOnly: true)} ${_commandContent('analyze')}'''; String generateTestScript( diff --git a/mono_repo/test/script_integration_outputs/readme_ci.txt b/mono_repo/test/script_integration_outputs/readme_ci.txt index 8cef0e5a..883f89fa 100644 --- a/mono_repo/test/script_integration_outputs/readme_ci.txt +++ b/mono_repo/test/script_integration_outputs/readme_ci.txt @@ -2,8 +2,9 @@ # Created with package:mono_repo v1.2.3 # Support built in commands on windows out of the box. + # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". +# then "flutter pub" is called instead of "dart pub". # This assumes that the Flutter SDK has been installed in a previous step. function pub() { if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then @@ -12,18 +13,13 @@ function pub() { command dart pub "$@" fi } -# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". -# This assumes that the Flutter SDK has been installed in a previous step. + function format() { - if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then - command flutter format "$@" - else - command dart format "$@" - fi + command dart format "$@" } + # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". +# then "flutter analyze" is called instead of "dart analyze". # This assumes that the Flutter SDK has been installed in a previous step. function analyze() { if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then diff --git a/tool/ci.sh b/tool/ci.sh index 47fe3a20..534d87f9 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -2,8 +2,9 @@ # Created with package:mono_repo v6.6.1 # Support built in commands on windows out of the box. + # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". +# then "flutter pub" is called instead of "dart pub". # This assumes that the Flutter SDK has been installed in a previous step. function pub() { if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then @@ -12,18 +13,13 @@ function pub() { command dart pub "$@" fi } -# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". -# This assumes that the Flutter SDK has been installed in a previous step. + function format() { - if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then - command flutter format "$@" - else - command dart format "$@" - fi + command dart format "$@" } + # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". +# then "flutter analyze" is called instead of "dart analyze". # This assumes that the Flutter SDK has been installed in a previous step. function analyze() { if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then