flutter/packages/flutter_tools/lib/src/commands
Matan Lurey 03749051e8
Always escape when writing pubspec.yaml's 'description' field. (#130096)
Closes https://github.com/flutter/flutter/issues/80013.

**Before**:

```
$ flutter create test1 --description "a: b"
Creating project test1...
Error detected in pubspec.yaml:
Error on line 2, column 15: Mapping values are not allowed here. Did you miss a colon earlier?
  ╷
2 │ description: a: b
  │               ^
  ╵
Please correct the pubspec.yaml file at /Users/matan/Developer/scratch/test1/pubspec.yaml
```

**After**:

```
$ flutter create test1 --description "a: b"
Creating project test1...
Resolving dependencies in test1... 
Got dependencies in test1.
Wrote 129 files.

All done!
You can find general documentation for Flutter at: https://docs.flutter.dev/
Detailed API documentation is available at: https://api.flutter.dev/
If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev

In order to run your application, type:

  $ cd test1
  $ flutter run

Your application code is in test1/lib/main.dart.
```

---

It's worth noting that this _always_ escapes a non-empty project description, which means that descriptions that were not previously wrapped in `"`s' will be. I'm not sure how worth it is to do a _conditional_ escape (i.e. only escape if not escaping would cause a problem), but willing to change.

Side-note: I had no idea where to list this test in the (very large) `create_test.dart`, so I did my best :)
2023-07-13 22:53:51 +00:00
..
analyze_base.dart Make --flutter-repo analyze whole repo (#127990) 2023-06-02 17:17:54 +00:00
analyze_continuously.dart Make --flutter-repo analyze whole repo (#127990) 2023-06-02 17:17:54 +00:00
analyze_once.dart Make --flutter-repo analyze whole repo (#127990) 2023-06-02 17:17:54 +00:00
analyze.dart Make --flutter-repo analyze whole repo (#127990) 2023-06-02 17:17:54 +00:00
assemble.dart [flutter_tools] fix cast error when dart-defines-json file includes null (#128909) 2023-06-16 18:12:22 +00:00
attach.dart Workaround for Dart VM timeout (#127875) 2023-06-02 17:17:57 +00:00
build_aar.dart flutter-tool: enum cleanup (#124760) 2023-04-14 01:55:05 +00:00
build_apk.dart Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
build_appbundle.dart flutter-tool: enum cleanup (#124760) 2023-04-14 01:55:05 +00:00
build_bundle.dart Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
build_ios_framework.dart Update collection-fors to prefer final (as per updated prefer_final_in_for_each) (#127511) 2023-05-26 23:34:36 +00:00
build_ios.dart tool: replace top-level functions with enum properties (#126167) 2023-05-05 19:10:07 +00:00
build_linux.dart tool: replace top-level functions with enum properties (#126167) 2023-05-05 19:10:07 +00:00
build_macos_framework.dart tool: replace top-level functions with enum properties (#126167) 2023-05-05 19:10:07 +00:00
build_macos.dart Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
build_web.dart tool-web-wasm: make wasm-opt an "option" instead of a "flag" (#126035) 2023-05-04 22:07:12 +00:00
build_windows.dart Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
build.dart Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
channel.dart [flutter_tools] Suppress git output in flutter channel (#128475) 2023-06-13 19:28:06 +00:00
clean.dart feature/clean-a-specific-scheme: Add this-scheme new flag for clean command (#116733) 2023-02-21 17:35:13 +00:00
config.dart [tools] allow explicitly specifying the JDK to use via a new config setting (#128264) 2023-06-07 04:52:17 +00:00
create_base.dart Always escape when writing pubspec.yaml's 'description' field. (#130096) 2023-07-13 22:53:51 +00:00
create.dart Update collection-fors to prefer final (as per updated prefer_final_in_for_each) (#127511) 2023-05-26 23:34:36 +00:00
custom_devices.dart Workaround for Dart VM timeout (#127875) 2023-06-02 17:17:57 +00:00
daemon.dart [testing] Make the FLUTTER_STORAGE_BASE_URL warning non-fatal (#128335) 2023-06-09 11:06:13 +00:00
debug_adapter.dart [flutter_tools] Clean up boolArgDeprecated and stringArgDeprecated (#122184) 2023-03-13 21:20:19 +00:00
devices.dart Add flag to filter by device connection interface (#124034) 2023-04-04 22:33:26 +00:00
doctor.dart [flutter_tools] cache flutter sdk version to disk (#124558) 2023-06-15 00:20:30 +00:00
downgrade.dart [flutter_tools] cache flutter sdk version to disk (#124558) 2023-06-15 00:20:30 +00:00
drive.dart [flutter_tools] only try to take a screenshot from flutter drive if the --screenshot flag is passed (#127150) 2023-05-19 19:14:17 +00:00
emulators.dart [flutter_tools] Clean up boolArgDeprecated and stringArgDeprecated (#122184) 2023-03-13 21:20:19 +00:00
generate_localizations.dart Throw error on unexpected positional arguments (#130274) 2023-07-10 12:12:23 -07:00
generate.dart Migrate doctor, format, and a few other commands to null safety (#92952) 2021-11-03 17:36:32 -07:00
ide_config.dart [flutter_tools] Clean up boolArgDeprecated and stringArgDeprecated (#122184) 2023-03-13 21:20:19 +00:00
install.dart Add flag to filter by device connection interface (#124034) 2023-04-04 22:33:26 +00:00
logs.dart Add flag to filter by device connection interface (#124034) 2023-04-04 22:33:26 +00:00
make_host_app_editable.dart Migrate channel, clean and a few other commands to null safety (#92950) 2021-11-03 17:33:05 -07:00
packages.dart Add spaces after flow control statements (#126320) 2023-05-15 11:07:30 +02:00
precache.dart [flutter_tools] Precache after channel switch (#118129) 2023-06-09 01:46:24 +00:00
run.dart Workaround for Dart VM timeout (#127875) 2023-06-02 17:17:57 +00:00
screenshot.dart Add flag to filter by device connection interface (#124034) 2023-04-04 22:33:26 +00:00
shell_completion.dart [flutter_tools] Clean up boolArgDeprecated and stringArgDeprecated (#122184) 2023-03-13 21:20:19 +00:00
symbolize.dart Add spaces after flow control statements (#126320) 2023-05-15 11:07:30 +02:00
test.dart rename generated asset manifest file back to AssetManifest.bin (from AssetManifest.smcbin) (#128529) 2023-06-09 21:20:50 +00:00
update_packages.dart Unpin path_provider_android (#129205) 2023-06-22 21:22:49 +00:00
upgrade.dart [flutter_tools] cache flutter sdk version to disk (#124558) 2023-06-15 00:20:30 +00:00
validate_project.dart Add spaces after flow control statements (#126320) 2023-05-15 11:07:30 +02:00