#!/usr/bin/env zsh

if ! [ -f ~/.cache/zsh/zcompdump ]; then
  exit 0
fi

# stat(1) differences between BSD and GNU
if is-mac; then
  # if [[ "$(date +'%j')" == "$(/usr/bin/stat -f '%m' ~/.cache/zsh/zcompdump | date +'%j')" ]]; then
  if test "$(date +'%j')" = "$(/usr/bin/stat -f '%m' ~/.cache/zsh/zcompdump | date +'%j')" >/dev/null; then
    exit 1
  fi
  exit 0
else
  if [[ "$(date +'%j')" == "$(stat -c '%y' ~/.cache/zsh/zcompdump | date +'%j')" ]]; then
    exit 1
  fi
  exit 0
fi
