Octo pack --include how to preseve folder

my repo looks like this:

dir1/
   file1.txt
   file2.txt
dir2/
   file3.txt
   file4.txt

I’m tryin to use Octo pack to create a package that only includes

dir1/
   file1.txt
   file2.txt

I’ve tried several ways of using the “include” flag, but whatever I try, the files are packaged without preserving the folder structure. I guess I’m asking for:

  • The documentation is very light in this area and should imho be improved on. It doesn’t include enough information about what the folder behavior is, and how “basePath” and “include” relates. I’m confused, because my impression would be that “basePath” should dictate the “start dir”, and thus any directory path specified using “include” would then result in a “directoried” package.

  • Any help in my particular case would be appreciated.

  • The documentation for “include” is probably wrong:
    “[Optional, Multiple] Add a file pattern to include, relative to the base path e.g. /bin/-.dll - if none are specified, defaults to **". /bin is not a relative path, its an absolute path on Linux. The relative path would be "bin/.dll” The hyphen also adds to the confusion. Again, I would ask that documenation would be improved to be clearer on this topic.

Hi @trond,

Thanks for getting in touch! I’m very sorry for the confusion and unexpected behavior you’re seeing with this --include argument within the pack command. I’m seeing the exact same behavior as you’re reporting in my local testing, and I certainly agree the descriptions in the documentation deserve some love to make this much clearer. I’m currently thinking of ways to do that, and I greatly appreciate the input on how to improve in this area. :slight_smile:

This --include argument will find matching files in the specified directories and include them in the package root is what I’m seeing. This can’t have a directory specified in the --include, and there’s no way I can see to control where the files are included into in the package’s directory structure. So in short it seems simply like this just isn’t smart enough to do what you’re requiring here, and would probably require some adjusting of the files/directories before the pack is done so it results in the structure you’re after.

I’m sorry it’s not the best of news! Let me know what you think or if you have any questions or concerns going forward.

Best regards,

Kenny