From d7a45afdb577fd5f0647168e960d2b0dbdfe1da1 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 2 Oct 2020 23:59:40 -0700 Subject: [PATCH] Update the timestamp setting script ti make shellcheck happy --- bin/set-timestamps-from-git | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/set-timestamps-from-git b/bin/set-timestamps-from-git index 7b9d99ce..fea2cc32 100755 --- a/bin/set-timestamps-from-git +++ b/bin/set-timestamps-from-git @@ -6,11 +6,10 @@ # This can be useful when build tools depend on file timestamps to # make caching decisions -for file in $(find src examples -type f -print) -do - timestamp=$(git log --pretty=format:%ad --date=format:%Y%m%d%H%M.%S -n 1 HEAD "$file" 2> /dev/null) +find src examples -type f -exec sh -c ' + timestamp=$(git log --pretty=format:%ad --date=format:%Y%m%d%H%M.%S -n 1 HEAD "$1" 2> /dev/null) if [ "x$timestamp" != "x" ]; then - touch -t "$timestamp" "$file" + touch -t "$timestamp" "$1" fi -done +' sh {} \;