Skip to content

Commit

Permalink
fix: convertation to yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
artegoser committed Aug 18, 2022
1 parent 4bf6169 commit 16aad56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ impl Interpreter {
write!(
output,
"{}",
serde_yaml::to_string(&self.commands).expect("Error when convert to yaml")
serde_yaml::to_string(&json! ({"main": self.commands}))
.expect("Error when convert to yaml")
)
.expect("Error when writing to file");

Expand All @@ -144,7 +145,7 @@ impl Interpreter {
write!(
output,
"{}",
serde_json::to_string(&self.commands).expect("Error when convert to json")
serde_json::to_string_pretty(&self.commands).expect("Error when convert to json")
)
.expect("Error when writing to file");

Expand Down

0 comments on commit 16aad56

Please sign in to comment.