diff --git a/README.md b/README.md index 9aaf73a..04bf7a7 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,13 @@ # FindOldMp3s -**TODO: Add description** +This project creates a CLI tool which will find MP3 files with bad bitrate. Bakeware will produce a standalone binary +file - this is NO escript release! -## Installation +## Setup -If [available in Hex](https://hex.pm/docs/publish), the package can be installed -by adding `find_old_mp3s` to your list of dependencies in `mix.exs`: - -```elixir -def deps do - [ - {:find_old_mp3s, "~> 0.1.0"} - ] -end +```shell +mix deps.get +MIX_ENV=prod mix release ``` -Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) -and published on [HexDocs](https://hexdocs.pm). Once published, the docs can -be found at . - +The built binary will be in `_build/prod/rel/bakeware/find_old_mp3s` diff --git a/lib/find_old_mp3s.ex b/lib/find_old_mp3s.ex index 45cb950..09aff15 100644 --- a/lib/find_old_mp3s.ex +++ b/lib/find_old_mp3s.ex @@ -1,18 +1,9 @@ -defmodule FindOldMp3s do - @moduledoc """ - Documentation for `FindOldMp3s`. - """ +defmodule FindOldMp3s.Main do + use Bakeware.Script - @doc """ - Hello world. - - ## Examples - - iex> FindOldMp3s.hello() - :world - - """ - def hello do - :world + @impl Bakeware.Script + def main(_args) do + IO.puts "Hello, World!" + 0 end end diff --git a/mix.exs b/mix.exs index 4c87eb7..3e31b63 100644 --- a/mix.exs +++ b/mix.exs @@ -1,28 +1,41 @@ defmodule FindOldMp3s.MixProject do use Mix.Project + @app :find_old_mp3s + def project do [ - app: :find_old_mp3s, + app: @app, version: "0.1.0", elixir: "~> 1.15", start_permanent: Mix.env() == :prod, - deps: deps() + deps: deps(), + releases: [{@app, release()}], + preferred_cli_env: [release: :prod] ] end # Run "mix help compile.app" to learn about applications. def application do [ - extra_applications: [:logger] + extra_applications: [:logger], + mod: {FindOldMp3s.Main, []} ] end # Run "mix help deps" to learn about dependencies. defp deps do [ - # {:dep_from_hexpm, "~> 0.3.0"}, - # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} + {:bakeware, "~> 0.2.4"} + ] + end + + defp release do + [ + overwrite: true, + quiet: true, + steps: [:assemble, &Bakeware.assemble/1], + strip_beams: Mix.env() == :prod ] end end diff --git a/mix.lock b/mix.lock new file mode 100644 index 0000000..ab3c2f0 --- /dev/null +++ b/mix.lock @@ -0,0 +1,4 @@ +%{ + "bakeware": {:hex, :bakeware, "0.2.4", "0aaf49b34f4bab2aa433f9ff1485d9401e421603160abd6d269c469fc7b65212", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "7b97bcf6fbeee53bb32441d6c495bf478d26f9575633cfef6831e421e86ada6d"}, + "elixir_make": {:hex, :elixir_make, "0.8.3", "d38d7ee1578d722d89b4d452a3e36bcfdc644c618f0d063b874661876e708683", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.0", [hex: :certifi, repo: "hexpm", optional: true]}], "hexpm", "5c99a18571a756d4af7a4d89ca75c28ac899e6103af6f223982f09ce44942cc9"}, +}