diff --git a/fpsdk_apps/yaml2shell/yaml2shell.cpp b/fpsdk_apps/yaml2shell/yaml2shell.cpp index 7dee70b..18419c9 100644 --- a/fpsdk_apps/yaml2shell/yaml2shell.cpp +++ b/fpsdk_apps/yaml2shell/yaml2shell.cpp @@ -303,6 +303,11 @@ class YamlToShell // - "Escape" single quotes StrReplace(val, "'", "'\"'\"'"); + // A YAML only consisting of a single scalar won't have a variable name + if (var.empty()) { + var = "value"; // like yq + } + std::string str = Sprintf("%s='%s'\n", var.c_str(), val.c_str()); size_ += str.size(); num_++;