unmountCodebase

tcmts.registry.unmountCodebase · #nrvrixyc · term · runs on the server

uses tcmts.registry.registryCodebase, which uses node:fs

Take a mirrored codebase's names out of the registry's codebase (its definitions stay, by hash).

import { namesNow, within } from "#codebase/tcmts/cli/libraries";
import { registryCodebase } from "#codebase/tcmts/registry";

export function unmountCodebase(mount: string): void {
  const cb = registryCodebase();
  const names = namesNow(cb.store);
  if (!names.some((n) => within(n.path, mount))) return;
  cb.store.setBranchNames(
    cb.store.branch().name,
    names.filter((n) => !within(n.path, mount)),
    `unmirror ${mount}`,
  );
}

uses

used by