Skip to content

Commit c665e6c

Browse files
authored
Merge pull request #116 from padelsbach/macos-dir-age-compare
Use different find command for comparing directory ages in script
2 parents 2b57ff2 + afaf002 commit c665e6c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

scripts/utils-general.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ fi
3030
check_folder_age() {
3131
folderA=$1
3232
folderB=$2
33-
folderA_age=$(find "$folderA" -type f -printf '%T@' | sort -n | tail -n 1)
34-
folderB_age=$(find "$folderB" -type f -printf '%T@' | sort -n | tail -n 1)
33+
34+
if [[ "$OSTYPE" == "darwin"* ]]; then
35+
folderA_age=$(find "$folderA" -type f -exec stat -f '%Dm' {} \; | sort -n | tail -n 1)
36+
folderB_age=$(find "$folderB" -type f -exec stat -f '%Dm' {} \; | sort -n | tail -n 1)
37+
else
38+
folderA_age=$(find "$folderA" -type f -printf '%T@' | sort -n | tail -n 1)
39+
folderB_age=$(find "$folderB" -type f -printf '%T@' | sort -n | tail -n 1)
40+
fi
3541

3642
if awk "BEGIN {exit !($folderA_age > $folderB_age)}"; then
3743
echo 1

scripts/utils-wolfprovider.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
2222
source ${SCRIPT_DIR}/utils-openssl.sh
2323
source ${SCRIPT_DIR}/utils-wolfssl.sh
24+
source ${SCRIPT_DIR}/utils-general.sh
2425

2526
WOLFPROV_SOURCE_DIR=${SCRIPT_DIR}/..
2627
WOLFPROV_INSTALL_DIR=${SCRIPT_DIR}/../wolfprov-install

0 commit comments

Comments
 (0)