For testing only.
| 660 | |
| 661 | // For testing only. |
| 662 | Try<list<Path>> FetcherProcess::cacheFiles() const |
| 663 | { |
| 664 | list<Path> result; |
| 665 | |
| 666 | if (!os::exists(flags.fetcher_cache_dir)) { |
| 667 | return result; |
| 668 | } |
| 669 | |
| 670 | const Try<list<string>> find = |
| 671 | os::find(flags.fetcher_cache_dir, CACHE_FILE_NAME_PREFIX); |
| 672 | |
| 673 | if (find.isError()) { |
| 674 | return Error("Could not access cache directory '" + |
| 675 | flags.fetcher_cache_dir + "' with error: " + find.error()); |
| 676 | } |
| 677 | |
| 678 | transform( |
| 679 | find->begin(), |
| 680 | find->end(), |
| 681 | std::back_inserter(result), |
| 682 | [](const string& path) { return Path(path); }); |
| 683 | |
| 684 | return result; |
| 685 | } |
| 686 | |
| 687 | |
| 688 | // For testing only. |