mix template.install (mix_templates v0.2.3)

A high-level summary:

  • mix template

    List the locally installed templates.

  • mix template.hex

    List the templates available on hex.

  • mix template.install «source»

    Install a template from source.

  • mix template.uninstall «name»

    Uninstall the template with the given name.

  • `mix template «name» --help Get template-specific help. Useful to discover the extra options a template supports. The «source» can be path/ the path to a local directory tree containing the template git https://path/to/git/repo git https://path/to/git/repo branch git_branch git https://path/to/git/repo tag git_tag git https://path/to/git/repo ref git_ref install from a git repository github user/project github user/project branch git_branch github user/project tag git_tag github user/project ref git_ref install from github from the given user and project hex hex_package hex hex_package 1.2.3 install from a hex package. Use mix template.hex to find available packages. Templates are installed in $MIX_HOME/templates (by default ~/.mix/templates).

Link to this section Summary

Functions

For installs involving a fetch, this will be executed as the in_package.

Checks that the install_spec and opts are supported

Fetches dep_spec with in_fetcher and then runs in_package.

Returns a list of already installed version of the same archive or escript.

Receives argv and opts from options parsing and returns an install_spec.

Prints a list of items in a uniform way. Used for printing the list of installed archives, escripts, and so on. The first parameter is the Mix.Local.Target module of the type of items.

Callback implementation for Mix.Task.run/1.

A common implementation for uninstalling archives and scripts.

Link to this section Functions

For installs involving a fetch, this will be executed as the in_package.

Link to this function

check_install_spec(_, _)

Checks that the install_spec and opts are supported

Link to this function

fetch(dep_spec, in_fetcher \\ &in_fetcher/1, in_package)

@spec fetch(tuple(), (atom() -> any()), (atom() -> any())) :: any()

Fetches dep_spec with in_fetcher and then runs in_package.

Generates a new mix project in a temporary directory with the given dep_spec added to a mix.exs. Then, in_fetcher is executed in the fetcher project. By default, this fetches the dependency, but you can provide an in_fetcher during test or for other purposes. After the in_fetcher is executed, in_package is executed in the now (presumably) fetched package, with the package's config overridden with the deps_path and lockfile of the fetcher package. Also, the Mix env is set to :prod.

Link to this function

find_previous_versions(src, dst)

Returns a list of already installed version of the same archive or escript.

Link to this function

install(argv, switches)

Link to this function

parse_args(argv, opts)

Receives argv and opts from options parsing and returns an install_spec.

@spec run(OptionParser.argv()) :: boolean()

Callback implementation for Mix.Task.run/1.

Link to this function

uninstall(target, argv)

@spec uninstall(atom(), OptionParser.argv()) :: boolean()

A common implementation for uninstalling archives and scripts.