Go Back

diff’ing two folders

Posted: 

I've been in Webpack refactoring land for a while now. It's a pretty ancient config in tech years so it needs to be a slow methodical process to get it up to date.

One of the first order of business is to re-organize. The current config has a lot of duplication and is super hard to read. That means the goal is to refactor the input but give the exact same output. That will help our confidence in our deployment because the built files are exactly the same.

Apps

Looked at some different comparison apps, none of which worked great. Meld was the best option for a while but it crashes every time I try to compare a folder now. Most of the apps on the app store are trial versions that only compare a certain number of files. Make sure you don't assume it's looking at everything when it tells you they are the same.

Use the command line

In this case there is a simple command line tool that comes with macOS: diff. Now I can quickly confirm my new build is the same as the old one.

diff -rq build buildOld

If it doesn't flag any files, boom you're done.