Class BowireStorageRoot

Namespace
Kuestenlogik.Bowire.Projects
Assembly
Kuestenlogik.Bowire.dll

Decides where a Bowire instance keeps its collections, environments, recordings and presets (#591).

public static class BowireStorageRoot
Inheritance
BowireStorageRoot
Inherited Members

Remarks

Two answers are possible, and which one applies is a property of the repository, not of whoever started the process:

  • No manifest, or one without "storage": "project" — the machine-wide ~/.bowire/. Unchanged behaviour, and still the default.
  • A .bowire/project.json that asks for project storage — that directory. The data then travels with the checkout, is git-diff-able, and two repos open at once no longer share one set of collections.

Reading it from the manifest rather than from a CLI flag is what makes it consistent: the CLI, the standalone tool and an IDE extension all discover the same file by walking up from where they were started, so the same checkout resolves to the same place no matter how Bowire was launched. A flag would have made the answer depend on the launcher, which is the class of bug this issue exists to remove — the VS Code extension claimed for months that running the CLI with the workspace as its working directory put .bowire/ next to the code, and the working directory had no bearing on it whatsoever.

Opt-in rather than automatic on purpose: rooting storage at the project the moment any manifest exists would silently relocate the data of everyone already using project.json for sources and rules.

Methods

Apply(string?)

Point Current at whatever Resolve(string?) decides. Called once at host start-up.

public static string Apply(string? startDirectory = null)

Parameters

startDirectory string

Returns

string

The root that was applied, for logging.

Resolve(string?)

The directory Bowire should store user data under, given where it was started.

public static string Resolve(string? startDirectory = null)

Parameters

startDirectory string

Where to begin the walk up for .bowire/project.json. Defaults to the current working directory.

Returns

string

BOWIRE_DATA_DIR when it is set; the project's .bowire/ directory when its manifest opts in; UserProfileRoot otherwise.