From 70f4fa26656d648af861ff771e9c6580e982dbce Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 6 Nov 2019 20:06:30 +0200 Subject: [PATCH] Remove platformio.description if none value is passed --- platformio/commands/home/rpc/handlers/project.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platformio/commands/home/rpc/handlers/project.py b/platformio/commands/home/rpc/handlers/project.py index dcb42ed7..80340a5a 100644 --- a/platformio/commands/home/rpc/handlers/project.py +++ b/platformio/commands/home/rpc/handlers/project.py @@ -60,7 +60,13 @@ class ProjectRPC(object): config = ProjectConfig(path, parse_extra=False, expand_interpolations=False) if not config.has_section("platformio"): config.add_section("platformio") - config.set("platformio", "description", text) + if text: + config.set("platformio", "description", text) + else: + if config.has_option("platformio", "description"): + config.remove_option("platformio", "description") + if not config.options("platformio"): + config.remove_section("platformio") return config.save() @staticmethod