rstudio / config

config package for R
https://rstudio.github.io/config/
256 stars 27 forks source link

Cannot update value to correspond config for nested structure #47

Closed psychelzh closed 1 year ago

psychelzh commented 1 year ago

See the following example:

withr::with_dir(
  tempdir(),
  {
    file <- "test.yaml"
    writeLines(
      "
default:
  test:
  - a: 1
    b: 2
  - a: 1
    b: 2

dev:
  test:
  - a: 1
    b: 3
  - a: 2
    b: 3
      ",
      file
    )
    config::get("test", file = file, config = "dev")
  }
)
#> [[1]]
#> [[1]]$a
#> [1] 1
#> 
#> [[1]]$b
#> [1] 2
#> 
#> 
#> [[2]]
#> [[2]]$a
#> [1] 1
#> 
#> [[2]]$b
#> [1] 2

Created on 2023-04-26 with reprex v2.0.2

psychelzh commented 1 year ago

Ah, it is a duplicate of #24. I am sorry.