Skip to content

Commit

Permalink
improvement: move_modules -> move_files
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Jul 2, 2024
1 parent 2c2a2e3 commit b13d58a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion documentation/configuring-igniter.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ See the documentation in `Igniter.Project.IgniterConfig` for available configura

## Moving modules

One available configuration is `module_location`. This configuration dictates where modules are placed when there is a folder that exactly matches their module name. There are two available strategies for this, and with igniter not only can you change your mind, but you can actually _move back and forth_ between each strategy. To move any modules to their rightful place, use `mix igniter.move_modules`.
One available configuration is `module_location`. This configuration dictates where modules are placed when there is a folder that exactly matches their module name. There are two available strategies for this, and with igniter not only can you change your mind, but you can actually _move back and forth_ between each strategy. To move any modules to their rightful place, use `mix igniter.move_files`.

> ### Only for matching modules {: .tip}
>
Expand Down
2 changes: 1 addition & 1 deletion lib/igniter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ defmodule Igniter do
warnings: Enum.uniq(igniter.warnings),
tasks: Enum.uniq(igniter.tasks)
}
|> Igniter.Code.Module.move_modules()
|> Igniter.Code.Module.move_files()
|> remove_unchanged_files()
end

Expand Down
2 changes: 1 addition & 1 deletion lib/igniter/code/module.ex
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ defmodule Igniter.Code.Module do
end

@doc false
def move_modules(igniter, opts \\ []) do
def move_files(igniter, opts \\ []) do
module_location_config = Igniter.Project.IgniterConfig.get(igniter, :module_location)
igniter = Igniter.include_glob(igniter, "lib/**/*.ex")

Expand Down
9 changes: 9 additions & 0 deletions lib/mix/tasks/igniter.move_files.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
defmodule Mix.Tasks.Igniter.MoveFiles do
@moduledoc "Moves any relavant files to their 'correct' location."
@shortdoc @moduledoc
use Igniter.Mix.Task

def igniter(igniter, _argv) do
Igniter.Code.Module.move_files(igniter, move_all?: true)
end
end
9 changes: 0 additions & 9 deletions lib/mix/tasks/igniter.move_modules.ex

This file was deleted.

0 comments on commit b13d58a

Please sign in to comment.