From 51db3db3e3c402fe16e2dd863590ba1f8023f3dd Mon Sep 17 00:00:00 2001 From: Tim Chambers Date: Tue, 26 Nov 2024 15:38:55 -0800 Subject: [PATCH] Fix dry_run reference --- lib/ex_unit_jumpstart/create_files.ex | 2 +- lib/ex_unit_jumpstart/move_files.ex | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ex_unit_jumpstart/create_files.ex b/lib/ex_unit_jumpstart/create_files.ex index d6df492..be8cad3 100644 --- a/lib/ex_unit_jumpstart/create_files.ex +++ b/lib/ex_unit_jumpstart/create_files.ex @@ -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 diff --git a/lib/ex_unit_jumpstart/move_files.ex b/lib/ex_unit_jumpstart/move_files.ex index abff053..58f9ca0 100644 --- a/lib/ex_unit_jumpstart/move_files.ex +++ b/lib/ex_unit_jumpstart/move_files.ex @@ -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