Skip to content

Commit

Permalink
f - Launch VSCode diff tool in case of differences - first pass
Browse files Browse the repository at this point in the history
  • Loading branch information
BigTom committed May 31, 2024
1 parent 6db919d commit d696f68
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/approvals.ex
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,18 @@ defmodule Approvals do
received_file_name = Namer.received_name(options)
Writer.write(data, received_file_name)

approved_file_name = Namer.approved_name(options)

received_data = File.read!(received_file_name)
approved_data = File.read!(Namer.approved_name(options))
approved_data = File.read!(approved_file_name)

cond do
approved_data == received_data ->
true

ExUnit.Assertions.assert(approved_data == received_data)
true ->
System.cmd("code", ["-d", received_file_name, approved_file_name])
ExUnit.Assertions.assert(approved_data == received_data)
end
end
end

0 comments on commit d696f68

Please sign in to comment.