mix rdmx.update (readmix v0.3.0)

Updates Readmix blocks in a file.

A backup of updated files is automatically done in the system temporary directory.

Readmix will use the default generators and context defined in the configuration for the :readmix application, under the :generators and :contexts keys:

# dev.exs

config :readmix,
  generators: [MyGenerator],
  contexts: [MyContext, Readmix.Contexts.Defaults]

Usage

mix rdmx.update [options] <path>

Options

  • -b, --backup- Perform a backup of the updated files. Defaults to true.

  • -d, --backup-dir <string>- Target directory to backup files before update. Defaults to System.tmp_dir!().

  • --var <string>- Provide variables for generators using the Readmix.Contexts.Defaults context.

    Variables must be given with a key and value:

    --var "some_key=some_value"
  • --help- Displays this help.

Examples

# Update a single file
mix rdmx.update README.md

# Update with custom variables
mix rdmx.update README.md --var "app_vsn=1.2.3"

# Update without backup
mix rdmx.update README.md --no-backup