question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve `addDirectory`

See original GitHub issue

Currently 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); 

ref. https://www.archiverjs.com/archiver#directory

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
acchoucommented, May 21, 2019

After using addDirectory a bit, I think you are right that it’s confusing with these semantics, and should be changed.

0reactions
teppeiscommented, May 25, 2019

@acchou Awesome! The options and implementation are simplified and extensible. It works well in my project. Thanks!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found