Improve `addDirectory`
See original GitHub issueCurrently addDirectory: "aaa" copies the sub directory of aaa under working directory in Lambda.
Project structure:
project-root
└── aaa
    └── bbb
        └── ccc
            └── file.js
Result:
working-dir-in-lambda
├── bbb
│   └── ccc
│       └── file.js
└── index.js
Is this intensional?
My expected behavior is coping aaa itself and the directory structure is preserved:
working-dir-in-lambda
├── aaa
│   └── bbb
│       └── ccc
│           └── file.js
└── index.js
The cause is the second arg false of archive.directory().
https://github.com/faastjs/faast.js/blob/2b22487a1c4466b0b5843cf8a897bb19f7a477f3/src/packer.ts#L94
If the second arg is omitted, it works as expected.
 archive.directory(await resolvePath(dir), false); 
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (4 by maintainers)
 Top Results From Across the Web
Top Results From Across the Web
ZipArchive.AddDirectory Overloads - C# & VB.NET
Recursively add files and directories to the archive directory named by the last component of the specified path. Feedback. Was this page helpful?...
Read more >ZipStorer how add directory? - Stack Overflow
I tried to do it like this: DirectoryInfo d = new DirectoryInfo(mydir); zip.AddDirectory(ZipStorer.Compression.Deflate, Path.GetFileName(d.
Read more >Use the AddDirectory component - ServiceNow Docs
Add the directory contents to an existing zip archive by using the AddDirectory component in RPA Desktop Design Studio.
Read more >TH1 Class Reference - ROOT
TH1::AddDirectory(kFALSE); // sets a global switch disabling the referencing ... Fill array with center of bins for 1D histogram Better to use h1....
Read more >Upgrade/Add Directory Listing - TroutLake.org
Upgrade or Add Your TroutLake.org Directory Listing ... Step 4: Complete the Information Request Form so we can upgrade or add your listing....
Read more > Top Related Medium Post
Top Related Medium Post
No results found
 Top Related StackOverflow Question
Top Related StackOverflow Question
No results found
 Troubleshoot Live Code
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free Top Related Reddit Thread
Top Related Reddit Thread
No results found
 Top Related Hackernoon Post
Top Related Hackernoon Post
No results found
 Top Related Tweet
Top Related Tweet
No results found
 Top Related Dev.to Post
Top Related Dev.to Post
No results found
 Top Related Hashnode Post
Top Related Hashnode Post
No results found

After using
addDirectorya bit, I think you are right that it’s confusing with these semantics, and should be changed.@acchou Awesome! The options and implementation are simplified and extensible. It works well in my project. Thanks!