Closed kaorihinata closed 2 months ago
I patched file.go
and state.go
to expect IndexKey
to be a string and my state will now happily load, but pressing enter on a state item currently crashes pug. Not sure if that's supposed to do something? I tested that on both the patched build, and the official build.
You've identified two bugs.
I've raised the one regarding pressing enter on a state here:
https://github.com/leg100/pug/issues/97
Re for_each
, I'll implement a fix shortly. It looks like - as you say with your patch - it can also be a string.
@kaorihinata Thanks for the thorough write-up of the issue. Please try out https://github.com/leg100/pug/releases/tag/v0.4.1.
Perfect! Bumped the package in my local tools and it's working just fine. Thank you so much.
Describe the bug
I've been converting some of my projects over to use pug, and it seems to be having issues parsing state where
for_each
is used to iterate over amap
(Edit:set
too). At the moment it seems to assume thatindex_key
will always be anint
which may be the case withset
s, but not withmap
s. (Edit: Just checked. Not the case forset
s either so I have no idea why it's declared asint
ininternal/state/file.go
.)I can still run things, but pug doesn't understand the resulting state, instead printing the following error in the logs:
Setup (please complete the following information):
To Reproduce
Steps to reproduce the behavior:
resource "time_sleep" "wait_three_seconds" { create_duration = each.value for_each = { duration = "3s" } }