Skip to content

Commit

Permalink
Fix dry_run reference
Browse files Browse the repository at this point in the history
  • Loading branch information
tjchambers committed Nov 26, 2024
1 parent 5449c9b commit 51db3db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/ex_unit_jumpstart/create_files.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule ExUnitJumpstart.CreateFiles do
String.replace(test_file.path, "_test.exs", ".ex") == code_file.path
end)

unless test_file or config.dry_run do
unless test_file or config.fetch!(:dry_run) do
IO.puts("Creating test file for #{code_file.path}")
create_test_file(config, code_file)
end
Expand Down
8 changes: 4 additions & 4 deletions lib/ex_unit_jumpstart/move_files.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ defmodule ExUnitJumpstart.MoveFiles do
Path.join(config[:test_dir], code_file.path) |> String.replace(".ex", "_test.exs")

IO.puts("Moving #{test_file.path} to #{new_path}")
unless config.dry_run do

File.mkdir_p!(Path.dirname(new_path))
File.rename!(Path.join(config[:test_dir], test_file.path), new_path)
unless config.fetch!(:dry_run) do
File.mkdir_p!(Path.dirname(new_path))
File.rename!(Path.join(config[:test_dir], test_file.path), new_path)
end
end
end
end
end

0 comments on commit 51db3db

Please sign in to comment.