From 9c07c40ebc2fdbe9fc70a11db09c475c63223a7c Mon Sep 17 00:00:00 2001 From: Pascal Schmid Date: Sat, 18 May 2024 01:07:30 +0200 Subject: [PATCH] Replace bakeware with burrito Bakeware has been deprecated --- .dialyzer_ignore.exs | 4 +--- .gitignore | 3 +++ README.md | 12 ++++++++++-- lib/find_old_mp3s.ex | 16 +++++----------- mix.exs | 20 ++++++++++++-------- mix.lock | 13 +++++++++++-- 6 files changed, 42 insertions(+), 26 deletions(-) diff --git a/.dialyzer_ignore.exs b/.dialyzer_ignore.exs index b66f5ba..fe51488 100644 --- a/.dialyzer_ignore.exs +++ b/.dialyzer_ignore.exs @@ -1,3 +1 @@ -[ - {"deps/bakeware/lib/bakeware/script.ex"} -] +[] diff --git a/.gitignore b/.gitignore index 070c82c..720a77f 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,7 @@ find_old_mp3s-*.tar # Temporary files, for example, from tests. /tmp/ +# Generated binary files +/burrito_out/ + .idea diff --git a/README.md b/README.md index d2b68a1..60eac09 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,18 @@ mix deps.get MIX_ENV=prod mix release ``` -The built binary will be in `_build/prod/rel/bakeware/find_old_mp3s` +The built binary will be in `burrito_out/example_cli_app_linux` ## Usage ```shell -_build/prod/rel/bakeware/find_old_mp3s "~/**/*.{mp3}" +./burrito_out/example_cli_app_linux "~/**/*.{mp3}" +``` + +## Development + +Clean cache: + +```shell +yes | burrito_out/example_cli_app_linux maintenance uninstall ``` diff --git a/lib/find_old_mp3s.ex b/lib/find_old_mp3s.ex index 2e1ad17..22b0012 100644 --- a/lib/find_old_mp3s.ex +++ b/lib/find_old_mp3s.ex @@ -1,17 +1,11 @@ -defmodule FindOldMp3s.Main do +defmodule FindOldMp3s.Application do @moduledoc """ Main module to run when invoking the binary """ - use Bakeware.Script - - @impl Bakeware.Script - def main(args) do - path = args - |> Path.expand - - Path.wildcard(path) |> Enum.each(fn path -> IO.puts(path) end) - - 0 + def start(_, _) do + args = Burrito.Util.Args.get_arguments() + |> parse_options + |> execute end end diff --git a/mix.exs b/mix.exs index 56f8894..1c0e30b 100644 --- a/mix.exs +++ b/mix.exs @@ -10,7 +10,7 @@ defmodule FindOldMp3s.MixProject do elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), - releases: [{@app, release()}], + releases: releases(), preferred_cli_env: [release: :prod] ] end @@ -19,25 +19,29 @@ defmodule FindOldMp3s.MixProject do def application do [ extra_applications: [:logger], - mod: {FindOldMp3s.Main, []} + mod: {FindOldMp3s.Application, []} ] end # Run "mix help deps" to learn about dependencies. defp deps do [ - {:bakeware, "~> 0.2.4"}, + {:burrito, "~> 1.0"}, {:credo, "~> 1.7.6", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4.3", only: [:dev, :test], runtime: false}, ] end - defp release do + def releases do [ - overwrite: true, - quiet: true, - steps: [:assemble, &Bakeware.assemble/1], - strip_beams: Mix.env() == :prod + example_cli_app: [ + steps: [:assemble, &Burrito.wrap/1], + burrito: [ + targets: [ + linux: [os: :linux, cpu: :x86_64], + ] + ] + ] ] end end diff --git a/mix.lock b/mix.lock index 11bb125..f01c5ed 100644 --- a/mix.lock +++ b/mix.lock @@ -1,10 +1,19 @@ %{ - "bakeware": {:hex, :bakeware, "0.2.4", "0aaf49b34f4bab2aa433f9ff1485d9401e421603160abd6d269c469fc7b65212", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "7b97bcf6fbeee53bb32441d6c495bf478d26f9575633cfef6831e421e86ada6d"}, "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, + "burrito": {:hex, :burrito, "1.0.5", "e6254309655bc3dc7e8362a55fffb2d470c62f79fe9d81672ff46493e1e9e410", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:req, "0.4.0", [hex: :req, repo: "hexpm", optional: false]}, {:typed_struct, "~> 0.2.0 or ~> 0.3.0", [hex: :typed_struct, repo: "hexpm", optional: false]}], "hexpm", "01c63f2fb7692e9bb55fb9e18b58287e57394b2d35a7b4670b3a678bde905953"}, + "castore": {:hex, :castore, "1.0.7", "b651241514e5f6956028147fe6637f7ac13802537e895a724f90bf3e36ddd1dd", [:mix], [], "hexpm", "da7785a4b0d2a021cd1292a60875a784b6caef71e76bf4917bdee1f390455cf5"}, "credo": {:hex, :credo, "1.7.6", "b8f14011a5443f2839b04def0b252300842ce7388f3af177157c86da18dfbeea", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "146f347fb9f8cbc5f7e39e3f22f70acbef51d441baa6d10169dd604bfbc55296"}, "dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"}, - "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"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"}, + "finch": {:hex, :finch, "0.18.0", "944ac7d34d0bd2ac8998f79f7a811b21d87d911e77a786bc5810adb75632ada4", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2.6 or ~> 1.0", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "69f5045b042e531e53edc2574f15e25e735b522c37e2ddb766e15b979e03aa65"}, + "hpax": {:hex, :hpax, "0.2.0", "5a58219adcb75977b2edce5eb22051de9362f08236220c9e859a47111c194ff5", [:mix], [], "hexpm", "bea06558cdae85bed075e6c036993d43cd54d447f76d8190a8db0dc5893fa2f1"}, "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, + "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"}, + "mint": {:hex, :mint, "1.6.0", "88a4f91cd690508a04ff1c3e28952f322528934be541844d54e0ceb765f01d5e", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "3c5ae85d90a5aca0a49c0d8b67360bbe407f3b54f1030a111047ff988e8fefaa"}, + "nimble_options": {:hex, :nimble_options, "1.1.0", "3b31a57ede9cb1502071fade751ab0c7b8dbe75a9a4c2b5bbb0943a690b63172", [:mix], [], "hexpm", "8bbbb3941af3ca9acc7835f5655ea062111c9c27bcac53e004460dfd19008a99"}, + "nimble_pool": {:hex, :nimble_pool, "1.1.0", "bf9c29fbdcba3564a8b800d1eeb5a3c58f36e1e11d7b7fb2e084a643f645f06b", [:mix], [], "hexpm", "af2e4e6b34197db81f7aad230c1118eac993acc0dae6bc83bac0126d4ae0813a"}, + "req": {:hex, :req, "0.4.0", "1c759054dd64ef1b1a0e475c2d2543250d18f08395d3174c371b7746984579ce", [:mix], [{:brotli, "~> 0.3.1", [hex: :brotli, repo: "hexpm", optional: true]}, {:ezstd, "~> 1.0", [hex: :ezstd, repo: "hexpm", optional: true]}, {:finch, "~> 0.9", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "f53eadc32ebefd3e5d50390356ec3a59ed2b8513f7da8c6c3f2e14040e9fe989"}, + "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, + "typed_struct": {:hex, :typed_struct, "0.3.0", "939789e3c1dca39d7170c87f729127469d1315dcf99fee8e152bb774b17e7ff7", [:mix], [], "hexpm", "c50bd5c3a61fe4e198a8504f939be3d3c85903b382bde4865579bc23111d1b6d"}, }