Skip to content
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

Use progress bar to show the progress of copying files #13

Merged
merged 1 commit into from
Nov 26, 2023

Commits on Nov 26, 2023

  1. Fixes #11 - Use progress bar to show the progress of copying files fr…

    …om each recognized source directory
    
    1. Add a new dependency on the `cli-progress` library (Npm package).
    2. Add a new `ProgressTracker` and `SingleDirBar` classes
       wrapping the `MultiBar` and `SingleBar` classes from the `cli-progress` library respectively
       to encapsulate the minutia of managing a console progress bar away from the main `Downloader` class.
    3. Update the `Downloader.downloadNewFilesFromDir` method:
        - use `ProgressTracker.startTracking` before starting the loop over `newFiles`
          in order to create a new progress bar to track the progress of downloading new file
          from the current source directory
        - update the progress bar state with each copied file
        - use `ProgressTracker.log` instead of `console.log` and similar methods
          in order to avoid conflicts with running progress bars
        - use `SingleDirBar.setStatusSummary` to 'log' the two `INFO` messages
          about 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
    andreiled committed Nov 26, 2023
    Configuration menu
    Copy the full SHA
    a7741ed View commit details
    Browse the repository at this point in the history