Accrue.Install.Fingerprints (accrue v0.3.0)

Copy Markdown View Source

No-clobber primitives for Accrue-generated host files.

Summary

Functions

Returns true when the on-disk file is still a pristine Accrue-generated file.

Redacts Stripe/API secret material before installer report output.

Adds the Accrue generated marker and SHA256 fingerprint to rendered content.

Returns true when a generated file contains user edits.

Writes new files and updates pristine generated files; skips user-edited files.

Writes a patch snippet artifact under .accrue/conflicts/patches/.

Writes a template replacement artifact under .accrue/conflicts/templates/.

Types

write_result()

@type write_result() ::
  {:changed, Path.t(), String.t()}
  | {:skipped, Path.t(), String.t()}
  | {:skipped, Path.t(), String.t(), Path.t()}

Functions

pristine?(path, new_content \\ nil)

@spec pristine?(Path.t(), String.t() | nil) :: boolean()

Returns true when the on-disk file is still a pristine Accrue-generated file.

redact(value)

@spec redact(term()) :: String.t()

Redacts Stripe/API secret material before installer report output.

stamp(content)

@spec stamp(String.t()) :: String.t()

Adds the Accrue generated marker and SHA256 fingerprint to rendered content.

user_edited?(path, new_content \\ nil)

@spec user_edited?(Path.t(), String.t() | nil) :: boolean()

Returns true when a generated file contains user edits.

write(path, content, opts \\ [])

@spec write(Path.t(), String.t(), keyword()) :: write_result()

Writes new files and updates pristine generated files; skips user-edited files.

write_patch_conflict(path, reason, snippet)

@spec write_patch_conflict(Path.t(), String.t(), String.t()) :: Path.t()

Writes a patch snippet artifact under .accrue/conflicts/patches/.

write_template_conflict(path, reason, content)

@spec write_template_conflict(Path.t(), String.t(), String.t()) :: Path.t()

Writes a template replacement artifact under .accrue/conflicts/templates/.