New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using flutter create
to repair a project with the --empty
option deletes test
folder
#134928
Comments
Thanks for the report @lucavenir
ie, while trying to run |
I updated the steps: I forgot to let you create the |
Thanks for the update. I followed the updated steps but don't seem to replicate the reported behavior. See below for the steps taken:
If you see the last section above, it does seem to have
I tried above using latest master version. |
I switched to the venir@venir:~$ flutter create my_app --empty
mkdir my_app/test
touch my_app/test/some_test.dart
cat my_app/test/some_test.dart # prints nothing, finds this file
flutter create my_app --empty # I want to repair this project, but I don't want to add any boilerplate
cat my_app/test/some_test.dart # ! No such file or directory
Creating project my_app...
Resolving dependencies in my_app... (2.8s)
Got dependencies in my_app.
Wrote 128 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 empty application, type:
$ cd my_app
$ flutter run
Your empty application code is in my_app/lib/main.dart.
Recreating project my_app...
my_app/test/widget_test.dart (created)
Resolving dependencies in my_app...
Got dependencies in my_app.
Wrote 2 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 empty application, type:
$ cd my_app
$ flutter run
Your empty application code is in my_app/lib/main.dart.
cat: my_app/test/some_test.dart: No such file or directory # !! I do receive the error. I'm not using MacOs, this is Linux tho. |
Thanks for the update. I do see the same behavior as reported now.
stable, master flutter doctor -v
|
I made a PR addressing this issue: #147160. |
@gspencergoog Do you happen to recall why flutter/packages/flutter_tools/lib/src/commands/create.dart Lines 454 to 459 in 5a63b1d
|
Is there an existing issue for this?
Steps to reproduce
Run the following commands sequentially:
Expected results
some_test.dart
shouldn't be deleted since we are just trying to repair this project after its initial creation.Actual results
The whole
test
folder is now gone.Alternatives I've considered
Using
flutter create
without the--empty
option. But that'll add the boilerplate I want to avoid.Context
I'm trying to set-up my own
mason
brick, with several files in bothlib
andtest
which.flutter create . --empty
is handy since it won't generate useless (within this context) files.Code sample
N.A.
Screenshots or Video
N.A.
Logs
N.A.
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: