|
3 | 3 | [](https://github.com/terenceponce/diff_check/actions/workflows/ci.yml) |
4 | 4 | [](https://codecov.io/gh/terenceponce/diff_check) |
5 | 5 |
|
6 | | -## Quick Start |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +Diff Check is a command-line tool that compares two files and prints the |
| 10 | +differences between them. |
| 11 | + |
| 12 | +The way this works is that it builds a 2D matrix of the two files by |
| 13 | +computing for the longest subsequence between each files. It then prints |
| 14 | +the differences between the two files by backtracking through the matrix. |
| 15 | + |
| 16 | +The LCS implementation used is based on this Wikipedia article: |
| 17 | + |
| 18 | +https://en.wikipedia.org/wiki/Longest_common_subsequence |
| 19 | + |
| 20 | +## Getting Started |
| 21 | + |
| 22 | +There are 2 ways to use this application. |
| 23 | + |
| 24 | +- Build the app from source |
| 25 | +- Download the executable and run it |
| 26 | + |
| 27 | +I recommend just building the app from source because downloading the |
| 28 | +executable requires you to have Erlang installed anyway. |
| 29 | + |
| 30 | +### Build from Source |
| 31 | + |
| 32 | +First, clone the repo and go to the new directory. |
7 | 33 |
|
8 | 34 | ``` |
9 | 35 | git clone git@github.com:terenceponce/diff_check.git |
10 | 36 | cd diff_check |
| 37 | +``` |
| 38 | + |
| 39 | +Next, make sure that you have the correct version Erlang and Elixir installed |
| 40 | +using [asdf](https://asdf-vm.com/). |
| 41 | + |
| 42 | +**NOTE**: If you are using a different version manager for Erlang and Elixir, |
| 43 | +feel free to ignore this step. |
| 44 | + |
| 45 | +``` |
11 | 46 | asdf install |
| 47 | +``` |
| 48 | + |
| 49 | +Next, install the dependencies needed by this repo and compile the executable. |
| 50 | + |
| 51 | +``` |
12 | 52 | mix deps.get |
13 | | -mix test |
| 53 | +mix escript.build |
14 | 54 | ``` |
| 55 | + |
| 56 | +Finally, run the executable. |
| 57 | + |
| 58 | +``` |
| 59 | +./diff_check path/to/base/file path/to/comparison/file |
| 60 | +``` |
| 61 | + |
| 62 | +If you don't have any files to compare, you can just use the fixtures used in |
| 63 | +the tests. |
| 64 | + |
| 65 | +``` |
| 66 | +./diff_check test/support/fixtures/test_response_1.json test/support/fixtures/test_response_2.json |
| 67 | +``` |
| 68 | + |
| 69 | +### Download and Run Executable |
| 70 | + |
| 71 | +**NOTE**: As I mentioned above, this step requires your machine to have Erlang |
| 72 | +installed which is why I recommend just building it from source if you're |
| 73 | +already at that point. |
| 74 | + |
| 75 | +First, go to the [Releases Page] and download the file that looks like this. |
| 76 | + |
| 77 | +``` |
| 78 | +diff_check-x.x.x |
| 79 | +``` |
| 80 | + |
| 81 | +Finally, run the executable. |
| 82 | + |
| 83 | +``` |
| 84 | +./diff_check-x-x-x path/to/base/file path/to/comparison/file |
| 85 | +``` |
| 86 | + |
| 87 | +If you don't have any files to compare, you can just use the fixtures used in |
| 88 | +the tests. |
| 89 | + |
| 90 | +``` |
| 91 | +./diff_check-x-x-x test/support/fixtures/test_response_1.json test/support/fixtures/test_response_2.json |
| 92 | +``` |
| 93 | + |
| 94 | +[Releases Page]: https://github.com/terenceponce/diff_check/releases |
0 commit comments