Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI tool does not work with substition #135

Open
lzm0 opened this issue Sep 5, 2023 · 1 comment
Open

CLI tool does not work with substition #135

lzm0 opened this issue Sep 5, 2023 · 1 comment
Labels

Comments

@lzm0
Copy link

lzm0 commented Sep 5, 2023

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.

@lzm0 lzm0 added the bug label Sep 5, 2023
@lzm0
Copy link
Author

lzm0 commented Sep 6, 2023

The issue is we are using

Hocon::ConfigFactory.parse_string(File.read("test.conf")).get_any_ref("b")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant