New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: allow files in directories to be downloaded onto local machine #2199
base: main
Are you sure you want to change the base?
Conversation
@ddelgrosso1 , I tried running Is that accurate? |
Also, I would like to add a test to check that the files are truly downloaded into the |
That is accurate. I wouldn't worry about running these on your own, they get run in the CI pipeline each time a commit is pushed. However, unit tests should work without issue locally.
If you feel up to it a unit test can probably be created to test this. I can look to see if we have any similar tests elsewhere that might serve as a guide. One thing I will do is to cleanup the the JS Docs to make it abundantly clear that not supplying a |
…nloadManyFiles to File.download
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@danielbankhead would you mind just giving this a second set of eyes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I think we can make it better for File#download
customers by moving the logic to TransferManager#downloadManyFiles
Hey @danielbankhead @ddelgrosso1 , just wanted to provide a heads up that I'll be revisiting this in about 1-2 months due to project priorities. Thank you for all the feedback and recommendations, they are all valid points for a user like myself. I do need something like Couple things I would design for, after both your feedback:
I envision users wanting to use TransferManager to download entire buckets or "sub-directories". So, those are some of the considerations I could think of. Something else that the |
@ddelgrosso1 Can you review this PR? I also drafted a summary of changes here fro your ease: go/node-transfermanager-gcs |
@@ -24,7 +24,7 @@ import { | |||
} from './file.js'; | |||
import pLimit from 'p-limit'; | |||
import * as path from 'path'; | |||
import {createReadStream, promises as fsp} from 'fs'; | |||
import {createReadStream, mkdirSync, promises as fsp} from 'fs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @danielbankhead noted in the doc, probably want the async version of mkdir.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #2200 🦕