From ac5b6d0f18ca11454773810ad2e8c1d84cfae07c Mon Sep 17 00:00:00 2001 From: Bart Van Bos Date: Tue, 5 Sep 2017 15:09:58 +0200 Subject: [PATCH] support for MacOS --- bin/grafana_dashboards_generate.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/grafana_dashboards_generate.sh b/bin/grafana_dashboards_generate.sh index f3ccd0d..b1744a5 100755 --- a/bin/grafana_dashboards_generate.sh +++ b/bin/grafana_dashboards_generate.sh @@ -62,6 +62,11 @@ CONFIGMAP_HEADER="$TEMPLATES_DIR/ConfigMap.header" OUTPUT_BASE_DIR="$TOOL_HOME/output" OUTPUT_FILE="$OUTPUT_BASE_DIR/grafana-dashboards-configMap-$DATE_EXEC.yaml" +if [[ "$OSTYPE" == "darwin"* ]]; then + STAT_PARAM="-f %z" +else + STAT_PARAM="-c%s" +fi # # Main Functions # @@ -133,7 +138,7 @@ bin-pack-files() { for file in $@; do # echo "debug: Processing file $(basename $file)" - file_size_bytes="$(stat -c%s "$file")" + file_size_bytes="$(stat $STAT_PARAM "$file")" # If the file is bigger than the configured limit we skip it file if [ "$file_size_bytes" -gt "$DATA_SIZE_LIMIT" ]; then