Skip to content

CLI tool does not work with substition #135

@lzm0

Description

@lzm0

Describe the Bug

Given a file test.conf

a = yes
b = ${a}

and the command

hocon -i test.conf get b

Gives the error

/opt/homebrew/lib/ruby/gems/3.2.0/gems/hocon-1.4.0/lib/hocon/impl/config_reference.rb:89:in `value_type': need to Config#resolve, see the API docs for Config#resolve; substitution not resolved: ConfigReference(${a}) (Hocon::ConfigError::ConfigNotResolvedError)
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/hocon-1.4.0/lib/hocon/impl/simple_config.rb:297:in `has_path?'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/hocon-1.4.0/lib/hocon/cli.rb:135:in `do_get'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/hocon-1.4.0/lib/hocon/cli.rb:116:in `main'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/hocon-1.4.0/bin/hocon:4:in `<top (required)>'
	from /opt/homebrew/opt/ruby/bin/hocon:25:in `load'
	from /opt/homebrew/opt/ruby/bin/hocon:25:in `<main>'

Environment

  • Version
    • 1.4.0
  • Platform
    • macOS Ventura 13.5.1
    • ruby 3.2.2

Additional Context

This should be fixed according to #67. Not sure why it is not working under CLI mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions