diff options
-rw-r--r-- | lib/leap_cli/config/manager.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/leap_cli/config/manager.rb b/lib/leap_cli/config/manager.rb index 2013217..ca739c3 100644 --- a/lib/leap_cli/config/manager.rb +++ b/lib/leap_cli/config/manager.rb @@ -331,6 +331,19 @@ module LeapCli @partials[partial_path] end + # + # Loads a json template file as a Hash (used only when creating a new node .json + # file for the first time). + # + def template(template) + path = Path.named_path([:template_config, template], Path.provider_base) + if File.exists?(path) + return load_json(path, Config::Object) + else + return nil + end + end + private def load_all_json(pattern, object_class, options={}) |