async getFiles()

in src/io/directory.ts [25:45]


  async getFiles(_walkPromise = walkPromise): Promise<Files> {
    // If we have already processed this directory and have data on this
    // instance return that.
    if (Object.keys(this.files).length) {
      this.stderr.debug(oneLine`Files already exist for directory
        "${this.path}" returning cached data`);
      return this.files;
    }

    const files = await _walkPromise(this.path, {
      shouldIncludePath: (_path: string, isDirectory: boolean) => {
        return this.shouldScanFile(_path, isDirectory);
      },
      stderr: this.stderr,
    });

    this.files = files;
    this.entries = Object.keys(files);

    return files;
  }