osrf / rocker

A tool to run docker containers with overlays and convenient options for things like GUIs etc.
Apache License 2.0
567 stars 74 forks source link

Create directory structure when writing files #244

Closed agyoungs closed 1 year ago

agyoungs commented 1 year ago

This simple change will allow an extension to have a directory structure for the files to copy into the container. This can simplify structuring the directory in the container if you simply wish to preserve the structure from the host machine.

agyoungs commented 1 year ago

This seems reasonable. This took longer to understand as looks like you made a few unnecessary changes and it only needs to be the one line change in L334.

Can you also add some tests to cover different cases with this as well as a proposed documentation update too?

Yeah, I renamed file_name to filepath because the specified location can now be a path (before, it would fail if it was a path).

I'll try to add some tests in the next day or two when I get a chance.

agyoungs commented 1 year ago

I forgot to come back to this until now, but let me know if you think the additional test is sufficient. I also added an explicit check for paths outside the temp directory.