Skip to content

Instantly share code, notes, and snippets.

@christianromney
Created April 2, 2019 19:56
Show Gist options
  • Save christianromney/f15a62bb784e69eab720bf695d30cb5d to your computer and use it in GitHub Desktop.
Save christianromney/f15a62bb784e69eab720bf695d30cb5d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -o pipefail
slow_compute_hash() {
find "$1" -type f -exec md5sum {} \; | sort -k 2 | md5sum
}
fast_compute_hash() {
find "$1" -type f -print0 | sort -z | xargs -0 md5sum | md5sum
}
PROJECT_ROOT=$(git rev-parse --show-toplevel)
echo "root: ${PROJECT_ROOT}"
#CSS_HASH=$(slow_compute_hash "${PROJECT_ROOT}/scss")
CSS_HASH=$(fast_compute_hash "${PROJECT_ROOT}/scss")
echo "css: ${CSS_HASH}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment