Given a `target`, is this the best way to get the ...
# development
n
Given a
target
, is this the best way to get the content as text? Had to search through Slack - it seems a little convoluted 🤷
Copy code
hydrated_source = await Get(HydratedSources, HydrateSourcesRequest(target[SourcesField]))

source_contents = await Get(DigestContents, Digest, 
hydrated_source.snapshot.digest)
    
text_content = source_contents[0].content.decode()
I'm just trying to modify a property in a json file (and write it back out).
c
yeah.. I think so. Granted, this is very verbose and low level, a high level abstraction for this could make sense to have.
n
Thanks. It is what it is... just a bit tricky trying to piece it together for the first time.
✔️ 1