mix_templates v0.1.6 Mix.Tasks.Template.Install

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).

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

A task needs to implement run which receives a list of command line args

A common implementation for uninstalling archives and scripts

Functions

build()

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

check_install_spec(, )

Checks that the install_spec and opts are supported

fetch(dep_spec, in_fetcher \\ &in_fetcher/1, in_package)
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.

find_previous_versions(src, dst)

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

install(argv, switches)
parse_args(argv, opts)

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

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

A task needs to implement run which receives a list of command line args.

Callback implementation for Mix.Task.run/1.

uninstall(target, argv)
uninstall(atom, OptionParser.argv) :: boolean

A common implementation for uninstalling archives and scripts.