Skip to content

Instantly share code, notes, and snippets.

@jwarlander
Forked from niku/cli.ex
Created January 10, 2017 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwarlander/d4d44132354a0dae13f1d5b47ef2c2c6 to your computer and use it in GitHub Desktop.
Save jwarlander/d4d44132354a0dae13f1d5b47ef2c2c6 to your computer and use it in GitHub Desktop.
defmodule MyApp.CLI do
def main(_args) do
IO.puts("Hello from MyApp!")
end
end
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[app: :my_app,
version: "0.0.1",
elixirc_paths: ["."],
escript: escript()]
end
def escript do
[main_module: MyApp.CLI]
end
end
@jwarlander
Copy link
Author

jwarlander commented Jan 10, 2017

If you're on Elixir 1.4+, you can install using:

mix escript.install git https://gist.github.com/d4d44132354a0dae13f1d5b47ef2c2c6.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment