<commit_before>#!/usr/bin/env zsh

if parent-ide > /dev/null; then
  return
fi

local git_opts=(--git-dir "$(realpath ${0:a:h}/..)/.git")
local UPDATES=$(git $git_opts log --oneline --no-patch origin/master...HEAD | wc -l)

if [[ $UPDATES -gt 0 ]]; then
  echo "${fg[yellow]}Updates for dotfiles detected.${terminfo[sgr0]}"
  echo
else
  git $git_opts fetch origin &> /dev/null &!
fi

# Update our cached version once a day.
if [[ ! -e ~/.alacritty-latest-version || "$(find ~/.alacritty-latest-version -mmin +1440)" ]]; then
  curl -s https://api.github.com/repos/jwilm/alacritty/tags | jq -r '.[].name' | head -n 1 | cut -c 2- > ~/.alacritty-latest-version
fi
if [[ -e ~/.alacritty-latest-version ]]; then
  /Applications/Alacritty.app/Contents/MacOS/alacritty --version | grep "$(cat ~/.alacritty-latest-version)" &> /dev/null || \
    echo "${fg[yellow]}Updates for Alacritty detected.${terminfo[sgr0]}"$'\n'
fi<commit_msg>fix: only check for alacritty updates if it's installed<commit_after>#!/usr/bin/env zsh

if parent-ide > /dev/null; then
  return
fi

local git_opts=(--git-dir "$(realpath ${0:a:h}/..)/.git")
local UPDATES=$(git $git_opts log --oneline --no-patch origin/master...HEAD | wc -l)

if [[ $UPDATES -gt 0 ]]; then
  echo "${fg[yellow]}Updates for dotfiles detected.${terminfo[sgr0]}"
  echo
else
  git $git_opts fetch origin &> /dev/null &!
fi

if [[ -e /Applications/Alacritty.app ]]; then
  # Update our cached version once a day.
  if [[ ! -e ~/.alacritty-latest-version || "$(find ~/.alacritty-latest-version -mmin +1440)" ]]; then
    curl -s https://api.github.com/repos/jwilm/alacritty/tags | jq -r '.[].name' | head -n 1 | cut -c 2- > ~/.alacritty-latest-version
  fi
  if [[ -e ~/.alacritty-latest-version ]]; then
    /Applications/Alacritty.app/Contents/MacOS/alacritty --version | grep "$(cat ~/.alacritty-latest-version)" &> /dev/null || \
      echo "${fg[yellow]}Updates for Alacritty detected.${terminfo[sgr0]}"$'\n'
  fi
fi
{'fraction_non_alphanumeric': 0.19734829168791432, 'fraction_numerical': 0.010198878123406425, 'mean_word_length': 3.418918918918919, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3174214', 'n_tokens_mistral': 788, 'n_tokens_neox': 753, 'n_words': 180}