Skip to content

Commit

Permalink
feat: renames mix task blend.premix to blend.gen.premix
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Sep 23, 2024
1 parent a69dc65 commit 0a53231
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ can be accomplished by customizing your `mix.exs` a bit, with the following step
##### 1. Create a new file `blend/premix.exs` with the following command:

```
mix blend.premix
mix blend.gen.premix
```

This will generate a `blend/premix.exs` file that needs to be compiled at the top of your `mix.exs` file
Expand Down Expand Up @@ -176,7 +176,7 @@ mix blend.get # Generate blend lockfiles
mix blend.update --all # Update blend lockfiles to latest possible versions
mix blend.list # List blends
mix blend.clean # Cleans blends build artifacts and stale lockfiles
mix blend.premix # Generate premix.exs file
mix blend.gen.premix # Generate premix.exs file
```


Expand Down
2 changes: 1 addition & 1 deletion lib/blend.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule Blend do
end
end

def premix do
def generate_premix do
path = Path.join(@blend_dir, @premix_file_name)

File.mkdir_p!(@blend_dir)
Expand Down
2 changes: 1 addition & 1 deletion lib/blend/templates/premix.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is autogenerated by blend package.
#
# Run `mix blend.premix` to update it's contents after
# Run `mix blend.gen.premix` to update it's contents after
# each blend package version update.

maybe_put_env = fn varname, value ->
Expand Down
16 changes: 16 additions & 0 deletions lib/mix/tasks/blend/gen.premix.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
defmodule Mix.Tasks.Blend.Gen.Premix do
@shortdoc "Generates premix.exs file"

@moduledoc """
Task to generate the `premix.exs` file, which helps confuguring your
package project to easily run any mix task against a specific blend
lockfile.
"""

use Mix.Task

@impl true
def run(_args) do
Blend.generate_premix()
end
end
10 changes: 2 additions & 8 deletions lib/mix/tasks/blend/premix.ex
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
defmodule Mix.Tasks.Blend.Premix do
@shortdoc "Generates premix.exs file"

@moduledoc """
Task to generate the `premix.exs` file, which helps confuguring your
package project to easily run any mix task against a specific blend
lockfile.
"""
@moduledoc false

use Mix.Task

@impl true
def run(_args) do
Blend.premix()
Blend.generate_premix()
end
end

0 comments on commit 0a53231

Please sign in to comment.