albertyw/dotfiles

View on GitHub
bin/dirdiff

Summary

Maintainability
Test Coverage
#!/bin/bash
# This script diffs the structure of two directories
# without comparing file contents

set -euo pipefail
IFS=$'\n\t'

file1="$(find "$1" | sed "s/^${1//\//\\/}//g" | sed "s/^\///g" | sort)"
file2="$(find "$2" | sed "s/^${2//\//\\/}//g" | sed "s/^\///g" | sort)"
diff <(echo "$file1") <(echo "$file2")