diff --git a/arch-setup/packages/sort-lists.sh b/arch-setup/packages/sort-lists.sh new file mode 100644 index 00000000..f15e1353 --- /dev/null +++ b/arch-setup/packages/sort-lists.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$HOME/GitProjects/setup/packages/" + + +readarray -d '' packagefiles < <(find "$HOME/GitProjects/setup/packages/" -name "*\.txt" -print0) + +for file in "${packagefiles[@]}"; do + echo "Sorting $file" + cat "$file" | sort > "${file}.tmp" && mv "${file}.tmp" "$file" +done