Skip to contents

Runs, in order, use_setup(), use_quarto() (a Quarto project only), use_dictionary(), use_hooks() (in a git work tree), use_ci() (when origin is on github.com) and use_agent_docs(), then sets the weft_version line of _weft.yml to the installed version (it updates an existing line in place). Run it again after updating weft to bring the files weft installed up to date.

Usage

use_weft(path = ".")

Arguments

path

A folder or one document, as for use_setup().

Value

The paths written, invisibly (character() when nothing changed).

Details

It plans every step first, prints the plan (weft will set up <root>:, then one line per step), and then writes. When any step cannot be done safely (a _quarto.yml or front matter it cannot edit, a link or a folder in a file's place) it writes nothing and stops with that step's message. A step that fails while writing (a folder that cannot be written to) undoes what the earlier steps wrote: files it created are removed and files it changed are put back, and the message says what was undone. It never asks, whether the session is interactive or not: the call is the consent. suppressMessages() silences it. dict_vale() is not called: it is a tool, not set-up.

Examples

if (FALSE) {
  # sets up the whole project: files, hook, workflow, agent skill
  use_weft()
}