From 16aad56fce0355f653d86f9db218ed3c62a9fc38 Mon Sep 17 00:00:00 2001 From: Artemy Date: Thu, 18 Aug 2022 11:30:22 +0300 Subject: [PATCH] fix: convertation to yaml --- src/interpreter.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/interpreter.rs b/src/interpreter.rs index b37bafb..f889271 100644 --- a/src/interpreter.rs +++ b/src/interpreter.rs @@ -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"); @@ -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");