You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open generated mason.yaml and delete all the contents
Run mason new test
You'll receive the following stack trace:
Marcuss-MBP-2:temp mtwichel$ mason new test
Unhandled exception:
ParsedYamlException: line 1, column 1: Not a map
╷
1 │
│ ^
╵
#0 checkedYamlDecode (package:checked_yaml/checked_yaml.dart:43:5)
#1 NewCommand.run (package:mason/src/commands/new_command.dart:68:23)
#2 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#3 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#4 new Future.sync (dart:async/future.dart:223:31)
#5 CommandRunner.run (package:args/command_runner.dart:112:14)
#6 main (file:///Users/mtwichel/.pub-cache/hosted/pub.dartlang.org/mason-0.0.1-dev.15/bin/mason.dart:27:20)
#7 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Expected Behavior
I would expect the CLI to generate a new bricks: entry in mason.yaml, then add my new brick to the file.
Background
I stumbled across this as I was trying out the new commands. The first thing I tried was mason init, said "cool this is great, I'll try it with my own template", then deleted everything that had generated from mason.yaml and tried mason new.
I believe this is occurring because the yaml parser isn't finding a valid yaml schema in the file because it's completely empty.
Potential Solutions
Two ideas I have:
Add try/catch to reading in mason.yaml and if something goes wrong, provide a more friendly message
Before parsing yaml file, make sure the file isn't empty. If it is, either show an error message or add bricks: entry
Let me know if you approve of these solution(s). I'm happy to submit a PR if need be.
The text was updated successfully, but these errors were encountered:
Steps to Reproduce
mason init
in new directorymason.yaml
and delete all the contentsmason new test
You'll receive the following stack trace:
Expected Behavior
I would expect the CLI to generate a new
bricks:
entry inmason.yaml
, then add my new brick to the file.Background
I stumbled across this as I was trying out the new commands. The first thing I tried was
mason init
, said "cool this is great, I'll try it with my own template", then deleted everything that had generated frommason.yaml
and triedmason new
.I believe this is occurring because the yaml parser isn't finding a valid yaml schema in the file because it's completely empty.
Potential Solutions
Two ideas I have:
mason.yaml
and if something goes wrong, provide a more friendly messagebricks:
entryLet me know if you approve of these solution(s). I'm happy to submit a PR if need be.
The text was updated successfully, but these errors were encountered: