Use progress bar to show the progress of copying files #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #11 - Use progress bar to show the progress of copying files from each recognized source directory
cli-progress
library (Npm package).ProgressTracker
andSingleDirBar
classeswrapping the
MultiBar
andSingleBar
classes from thecli-progress
library respectivelyto encapsulate the minutia of managing a console progress bar away from the main
Downloader
class.Downloader.downloadNewFilesFromDir
method:ProgressTracker.startTracking
before starting the loop overnewFiles
in order to create a new progress bar to track the progress of downloading new file
from the current source directory
ProgressTracker.log
instead ofconsole.log
and similar methodsin order to avoid conflicts with running progress bars
SingleDirBar.setStatusSummary
to 'log' the twoINFO
messagesabout saving source directory cursor position (aka latest processed file)
after downloading all new files from a given source directory
in order to show the latest of the two to the right of the associated completed progress bar
Manual Testing
Using a memory card that had a few new photos since the last time I downloaded photos from it using this tool.
Manually update the
cursor.json
file on my memory card to roll it two files back in order to have the tool pick up the two most recently copied files as if they were new.Run the tool to copy new photos:
npm run build && node dist
console.log
would.