UNPKG

345 BPlain TextView Raw
1#!/bin/bash
2reason=$1
3target=$2
4[ -z "$target" ] && target="src"
5[ -z "$reason" ] && reason="any"
6hash=`find "$target" -type f -print0 | sort -z | xargs -0 md5sum | md5sum | cut -d " " -f 1`
7mkdir -p temp
8
9[ -f "temp/_last_hash.$reason" ] && [ "`cat temp/_last_hash.$reason`" = "$hash" ] && exit 0
10
11echo $hash > temp/_last_hash.$reason
12exit 1
13