#This is probably a really silly question

1 messages · Page 1 of 1 (latest)

strong coral
#

I believe it is dag.CurrentModule().Source() but the Source method cannot see any files outside dagger directory.

nocturne vine
#

Huh.. thanks I'll test that! I only want to access what I pass into the function.

nocturne vine
#

that didn't work. What I pass to the function is not available in dag.CurrentModule().Source(). Only the module source

nocturne vine
#

For simple text files I can do file.Contents(ctx). But what if I wanted to do something more advanced like unzip a tar file, read and parse an xml file. I know I can do these things with CLI tools within a container. But I want to use Go instead but also want to do it in a dagger function.

leaden escarp
#

You can call .Export() inside the function which will save to the runtime container and access with go from there. Each function runs in an empty /scratch directory as the working directory. You can use it as needed.