Skip to content

Directories in templates #2

@biozz

Description

@biozz

I am using latest docker image of trusted-cgi and was not able to create a lambda from Nim template with an error saying:

Error: -30000: create lambda: write file src/lambda.nim content: open /data/b37de1ee-1e86-4209-b817-7ecb321d696f/src/lambda.nim: no such file or directory

Nim template is the only one that has directory in the template definition - src/lambda.nim. So I then went through the sources and discovered, that files are created with WriteFile:

err := ioutil.WriteFile(destFile, []byte(content), 0755)

But WriteFile can't handle directories. It should be possible to parse file path and do something like MkdirAll with it. What do you think?

PS: I am not a Nim developer and have just discovered trusted-cgi a couple of days ago; you have done an amazing job, thank you for that simple and straightforward solution!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions