简体   繁体   中英

What is the best way to package Elixir CLI application?

Suppose I have a CLI application with subcommands and arguments (like application foo --bar baz ). How can I package it for distribution without requiring user to install Erlang?

I know there's mix escript Mix task, but it builds a binary that requires Erlang to be installed, also Mix reference states that escripts should be used only for development purposes. mix release , however, produces redundant shell scripts that I don't want to see in dist.

So, is there a way to make a standalone distributable of an Elixir CLI application?

PS This is actually my first experience with Elixir (and the whole Erlang ecosystem)

Elixir applications can be packaged asErlang releases , see also here . These can include Erlang VM. Elixir since 1.9 supports building releases without extra tooling, using included mix task mix release - please check the documentation for greasy details: https://hexdocs.pm/mix/Mix.Tasks.Release.html

You might benefit from a quick look at this blog post for inspiration and conceptual overview, noticing that for simple CLI app it is much simpler: https://www.cogini.com/blog/best-practices-for-deploying-elixir-apps/

Bakeware generates a single executable file.

They have added a CLI app example here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM