Save the index to the cache folder if it was not loaded from disk.
(index: SembleIndex, path: str)
| 33 | |
| 34 | |
| 35 | def _maybe_save_index(index: SembleIndex, path: str) -> None: |
| 36 | """Save the index to the cache folder if it was not loaded from disk.""" |
| 37 | if not index.loaded_from_disk: |
| 38 | try: |
| 39 | cache_folder = find_index_from_cache_folder(path) |
| 40 | index.save(cache_folder) |
| 41 | except Exception as e: |
| 42 | print(f"Error saving index: {e}", file=sys.stderr) |
| 43 | |
| 44 | |
| 45 | def _add_content_args(p: argparse.ArgumentParser) -> None: |