mix_templates v0.1.3 Mix.Tasks.Template.Install
Manage the local installation and uninstallation of templates used
by mix gen
.
Usage:
mix template [list]
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.
The «source» can be
the name of a Hex project containing the template
a local file path (starting with a
.
or/
)
Templates are installed in MIX_HOME/templates (by default ~/.mix/templates).
For more on templates, see
- Mix.Tasks.Template
- Mix.Tasks.Template.hex
- Mix.Tasks.Template.uninstall
See Mix.Tasks.Gen
for details on how to use these 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
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.
Returns a list of already installed version of the same archive or escript.
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.
Callback implementation for Mix.Task.run/1
.
A common implementation for uninstalling archives and scripts.