about summary refs log tree commit diff
path: root/profile/.profile.d/50_diff.sh
blob: 925365776158a1036cc749aab72be578d77dd18b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

_diffs="
colordiff
diff
"

for _diff in ${_diffs}; do
	# shellcheck disable=SC2139
	if command -v "${_diff}" >/dev/null 2>&1; then
		export DIFF="${_diff}"

		alias d="${DIFF}"
		if ! command -v di >/dev/null 2>&1; then
			alias di="${DIFF}"
		fi

		break
	fi
done

unset _diff _diffs

Consider giving Nix/NixOS a try! <3