Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit61a33237e0

README.md

zeromind.foldCopy

Fold a copy of installed content back into the installed asset it was copied from. This is a recovery tool: edit installed content in place, where the install put it, and the install becomes a modified install that zm status lists and zm pr create <root> offers back to the world it came from.

A copy (made with cp, or by writing the files somewhere else) is a new asset with a guid of its own. It is disconnected from the install: its edits are not edits to the installed asset, zm status does not list them as a modified install, and contributing the install does not carry them. Nothing reconnects a copy on its own. This tool does, when you name the copy and the installed asset it came from:

  • each file of the copy is written over the file at the same path inside the installed asset, which keeps its guid and becomes a modified install; files only the installed asset holds stay (kept);
  • every reference this world makes to the copy, or to a file in it, is rewritten to name the installed asset (repointed); one it cannot restate is named in unrepointed;
  • the copy is removed.

{ copy = ..., into = ..., dryRun = true } lists what would be written without changing anything. Nothing is committed: the next commit carries the modified install and the copy's removal. into must be installed content (an install's root or a dependency it placed, as zeromind.installs lists them, or an asset inside one), and copy must not be.