Skip to main content

reinit_backend

Function reinit_backend 

Source
pub async fn reinit_backend<B: Backend>(
    project: &Project,
) -> Result<B, FailToInitBackend>
Expand description

Re-initialize a backend, preserving cache directories.

This function:

  1. Identifies cache paths that should be preserved (from Backend::CACHE_PATHS)
  2. Deletes all non-cache items in the backend directory
  3. Calls Backend::init() to re-scaffold the backend

This allows template updates to be applied while keeping expensive build caches.

ยงErrors

Returns an error if the backend directory cannot be read, cleaned, or re-initialized.